mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 18:05:58 +02: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:
@@ -40,7 +40,7 @@ CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniVal
|
||||
CMutableTransaction rawTx;
|
||||
|
||||
if (!locktime.isNull()) {
|
||||
int64_t nLockTime = locktime.get_int64();
|
||||
int64_t nLockTime = locktime.getInt<int64_t>();
|
||||
if (nLockTime < 0 || nLockTime > LOCKTIME_MAX)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, locktime out of range");
|
||||
rawTx.nLockTime = nLockTime;
|
||||
@@ -55,7 +55,7 @@ CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniVal
|
||||
const UniValue& vout_v = find_value(o, "vout");
|
||||
if (!vout_v.isNum())
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key");
|
||||
int nOutput = vout_v.get_int();
|
||||
int nOutput = vout_v.getInt<int>();
|
||||
if (nOutput < 0)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout cannot be negative");
|
||||
|
||||
@@ -71,7 +71,7 @@ CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniVal
|
||||
// set the sequence number if passed in the parameters object
|
||||
const UniValue& sequenceObj = find_value(o, "sequence");
|
||||
if (sequenceObj.isNum()) {
|
||||
int64_t seqNr64 = sequenceObj.get_int64();
|
||||
int64_t seqNr64 = sequenceObj.getInt<int64_t>();
|
||||
if (seqNr64 < 0 || seqNr64 > CTxIn::SEQUENCE_FINAL) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, sequence number is out of range");
|
||||
} else {
|
||||
@@ -177,7 +177,7 @@ void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keyst
|
||||
|
||||
uint256 txid = ParseHashO(prevOut, "txid");
|
||||
|
||||
int nOut = find_value(prevOut, "vout").get_int();
|
||||
int nOut = find_value(prevOut, "vout").getInt<int>();
|
||||
if (nOut < 0) {
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "vout cannot be negative");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user