Skip to content

Commit

Permalink
cli: create GetNewAddress()
Browse files Browse the repository at this point in the history
Summary:
This is a backport of [[bitcoin/bitcoin#19133 | core#19133]] [3/10]
bitcoin/bitcoin@f7c65a3

Depends on D9942

Test Plan: `ninja`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9943
  • Loading branch information
jonatack authored and PiRK committed Aug 26, 2021
1 parent bc48276 commit 2370615
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,16 @@ static void GetWalletBalances(UniValue &result) {
result.pushKV("balances", balances);
}

/**
* Call RPC getnewaddress.
* @returns getnewaddress response as a UniValue object.
*/
[[maybe_unused]] static UniValue GetNewAddress() {
std::unique_ptr<BaseRequestHandler> rh{
std::make_unique<DefaultRequestHandler>()};
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{});
}

static int CommandLineRPC(int argc, char *argv[]) {
std::string strPrint;
int nRet = 0;
Expand Down

0 comments on commit 2370615

Please sign in to comment.