diff options
author | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-24 19:28:14 +0100 |
---|---|---|
committer | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-12-17 21:13:44 +0100 |
commit | 8dec9c560b53488c1e71d8f74241c7dce42cb387 (patch) | |
tree | 6b9bb8441bcb33a957149339e8e1d4703328d920 /src/node | |
parent | 3695ecbf680a66b718f97d504308578d001eec49 (diff) | |
download | bitcoin-8dec9c560b53488c1e71d8f74241c7dce42cb387.tar.xz |
wallet, mempool: propagete `checkChainLimits` error message to wallet
Update CheckPackageLimits to use util::Result to pass the error message
instead of out parameter.
Also update test to reflect the error message from `CTxMempool`
`CheckPackageLimits` output.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 2e547e8e2c..6963e928fe 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -45,6 +45,7 @@ #include <uint256.h> #include <univalue.h> #include <util/check.h> +#include <util/result.h> #include <util/signalinterrupt.h> #include <util/translation.h> #include <validation.h> @@ -702,14 +703,13 @@ public: limit_ancestor_count = limits.ancestor_count; limit_descendant_count = limits.descendant_count; } - bool checkChainLimits(const CTransactionRef& tx) override + util::Result<void> checkChainLimits(const CTransactionRef& tx) override { - if (!m_node.mempool) return true; + if (!m_node.mempool) return {}; LockPoints lp; CTxMemPoolEntry entry(tx, 0, 0, 0, 0, false, 0, lp); LOCK(m_node.mempool->cs); - std::string err_string; - return m_node.mempool->CheckPackageLimits({tx}, entry.GetTxSize(), err_string); + return m_node.mempool->CheckPackageLimits({tx}, entry.GetTxSize()); } CFeeRate estimateSmartFee(int num_blocks, bool conservative, FeeCalculation* calc) override { |