aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-02-14 17:10:34 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-02-15 10:56:01 +0100
commitfa2a4fdef779b01e847def5985deafedc6dd3da8 (patch)
treec8e275c0c7f3eaa1b42933f332602d6b2be9b320 /src/rpc
parentfade94d11a5b93113975c4b2f62a357a70d03191 (diff)
downloadbitcoin-fa2a4fdef779b01e847def5985deafedc6dd3da8.tar.xz
rpc: Fixed signed integer overflow for large feerates
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/mempool.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp
index c1753a1f6e..a5d27d7472 100644
--- a/src/rpc/mempool.cpp
+++ b/src/rpc/mempool.cpp
@@ -81,9 +81,7 @@ static RPCHelpMan sendrawtransaction()
CTransactionRef tx(MakeTransactionRef(std::move(mtx)));
- const CFeeRate max_raw_tx_fee_rate = request.params[1].isNull() ?
- DEFAULT_MAX_RAW_TX_FEE_RATE :
- CFeeRate(AmountFromValue(request.params[1]));
+ const CFeeRate max_raw_tx_fee_rate{ParseFeeRate(self.Arg<UniValue>(1))};
int64_t virtual_size = GetVirtualTransactionSize(*tx);
CAmount max_raw_tx_fee = max_raw_tx_fee_rate.GetFee(virtual_size);
@@ -162,9 +160,7 @@ static RPCHelpMan testmempoolaccept()
"Array must contain between 1 and " + ToString(MAX_PACKAGE_COUNT) + " transactions.");
}
- const CFeeRate max_raw_tx_fee_rate = request.params[1].isNull() ?
- DEFAULT_MAX_RAW_TX_FEE_RATE :
- CFeeRate(AmountFromValue(request.params[1]));
+ const CFeeRate max_raw_tx_fee_rate{ParseFeeRate(self.Arg<UniValue>(1))};
std::vector<CTransactionRef> txns;
txns.reserve(raw_transactions.size());