mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
scripted-diff: Use getInt<T> over get_int/get_int64
-BEGIN VERIFY SCRIPT- sed -i 's|\<get_int64\>|getInt<int64_t>|g' $(git grep -l get_int ':(exclude)src/univalue') sed -i 's|\<get_int\>|getInt<int>|g' $(git grep -l get_int ':(exclude)src/univalue') -END VERIFY SCRIPT-
This commit is contained in:
@@ -109,7 +109,7 @@ static RPCHelpMan getnetworkhashps()
|
||||
{
|
||||
ChainstateManager& chainman = EnsureAnyChainman(request.context);
|
||||
LOCK(cs_main);
|
||||
return GetNetworkHashPS(!request.params[0].isNull() ? request.params[0].get_int() : 120, !request.params[1].isNull() ? request.params[1].get_int() : -1, chainman.ActiveChain());
|
||||
return GetNetworkHashPS(!request.params[0].isNull() ? request.params[0].getInt<int>() : 120, !request.params[1].isNull() ? request.params[1].getInt<int>() : -1, chainman.ActiveChain());
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -217,8 +217,8 @@ static RPCHelpMan generatetodescriptor()
|
||||
"\nGenerate 11 blocks to mydesc\n" + HelpExampleCli("generatetodescriptor", "11 \"mydesc\"")},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
const int num_blocks{request.params[0].get_int()};
|
||||
const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].get_int()};
|
||||
const int num_blocks{request.params[0].getInt<int>()};
|
||||
const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].getInt<int>()};
|
||||
|
||||
CScript coinbase_script;
|
||||
std::string error;
|
||||
@@ -264,8 +264,8 @@ static RPCHelpMan generatetoaddress()
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
const int num_blocks{request.params[0].get_int()};
|
||||
const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].get_int()};
|
||||
const int num_blocks{request.params[0].getInt<int>()};
|
||||
const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].getInt<int>()};
|
||||
|
||||
CTxDestination destination = DecodeDestination(request.params[1].get_str());
|
||||
if (!IsValidDestination(destination)) {
|
||||
@@ -462,7 +462,7 @@ static RPCHelpMan prioritisetransaction()
|
||||
LOCK(cs_main);
|
||||
|
||||
uint256 hash(ParseHashV(request.params[0], "txid"));
|
||||
CAmount nAmount = request.params[2].get_int64();
|
||||
CAmount nAmount = request.params[2].getInt<int64_t>();
|
||||
|
||||
if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Priority is no longer supported, dummy argument to prioritisetransaction must be 0.");
|
||||
@@ -657,7 +657,7 @@ static RPCHelpMan getblocktemplate()
|
||||
// NOTE: It is important that this NOT be read if versionbits is supported
|
||||
const UniValue& uvMaxVersion = find_value(oparam, "maxversion");
|
||||
if (uvMaxVersion.isNum()) {
|
||||
nMaxVersionPreVB = uvMaxVersion.get_int64();
|
||||
nMaxVersionPreVB = uvMaxVersion.getInt<int64_t>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user