aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-09-02 13:09:11 +0100
committerglozow <gloriajzhao@gmail.com>2021-10-28 15:58:54 +0100
commit36a8441912bf84b4da9c74826dcd42533d8abaaa (patch)
tree0d65ed2f257ad67ec05732e839fe7a4c8ba87c15 /src/rpc/rawtransaction.cpp
parent8fa2936b34fda9c0bea963311fa80a04b4bf5867 (diff)
downloadbitcoin-36a8441912bf84b4da9c74826dcd42533d8abaaa.tar.xz
[validation/rpc] cache + use vsize calculated in PreChecks
This is not only cleaner but also helps make sure we are always using the virtual size measure that includes the sigop weight heuristic (which is the vsize the mempool would return).
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r--src/rpc/rawtransaction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 483717aa7a..fd18d4c96d 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -977,7 +977,7 @@ static RPCHelpMan testmempoolaccept()
if (tx_result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
const CAmount fee = tx_result.m_base_fees.value();
// Check that fee does not exceed maximum fee
- const int64_t virtual_size = GetVirtualTransactionSize(*tx);
+ const int64_t virtual_size = tx_result.m_vsize.value();
const CAmount max_raw_tx_fee = max_raw_tx_fee_rate.GetFee(virtual_size);
if (max_raw_tx_fee && fee > max_raw_tx_fee) {
result_inner.pushKV("allowed", false);