mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-27 09:21:43 +02:00
rpc: make generatetoaddress locals const
and named the same as in generatetodescriptor just above.
This commit is contained in:
parent
cb00510dba
commit
9be7fd35c5
@ -257,11 +257,8 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
|
|||||||
},
|
},
|
||||||
}.Check(request);
|
}.Check(request);
|
||||||
|
|
||||||
int nGenerate = request.params[0].get_int();
|
const int num_blocks{request.params[0].get_int()};
|
||||||
uint64_t nMaxTries{DEFAULT_MAX_TRIES};
|
const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].get_int()};
|
||||||
if (!request.params[2].isNull()) {
|
|
||||||
nMaxTries = request.params[2].get_int();
|
|
||||||
}
|
|
||||||
|
|
||||||
CTxDestination destination = DecodeDestination(request.params[1].get_str());
|
CTxDestination destination = DecodeDestination(request.params[1].get_str());
|
||||||
if (!IsValidDestination(destination)) {
|
if (!IsValidDestination(destination)) {
|
||||||
@ -273,7 +270,7 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
|
|||||||
|
|
||||||
CScript coinbase_script = GetScriptForDestination(destination);
|
CScript coinbase_script = GetScriptForDestination(destination);
|
||||||
|
|
||||||
return generateBlocks(chainman, mempool, coinbase_script, nGenerate, nMaxTries);
|
return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
|
||||||
}
|
}
|
||||||
|
|
||||||
static UniValue generateblock(const JSONRPCRequest& request)
|
static UniValue generateblock(const JSONRPCRequest& request)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user