diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/chain.cpp | 5 | ||||
-rw-r--r-- | src/interfaces/chain.h | 5 | ||||
-rw-r--r-- | src/interfaces/wallet.cpp | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index b8b9ecded9..b7cd65ff3a 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -298,6 +298,11 @@ public: { ::mempool.GetTransactionAncestry(txid, ancestors, descendants); } + void getPackageLimits(unsigned int& limit_ancestor_count, unsigned int& limit_descendant_count) override + { + limit_ancestor_count = gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT); + limit_descendant_count = gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT); + } bool checkChainLimits(const CTransactionRef& tx) override { LockPoints lp; diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index da670a3370..73a78e21fb 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -163,6 +163,11 @@ public: //! Calculate mempool ancestor and descendant counts for the given transaction. virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0; + //! Get the node's package limits. + //! Currently only returns the ancestor and descendant count limits, but could be enhanced to + //! return more policy settings. + virtual void getPackageLimits(unsigned int& limit_ancestor_count, unsigned int& limit_descendant_count) = 0; + //! Check if transaction will pass the mempool's chain limits. virtual bool checkChainLimits(const CTransactionRef& tx) = 0; diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 0c8d92eba5..aff08bfbea 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -241,7 +241,7 @@ public: } bool transactionCanBeBumped(const uint256& txid) override { - return feebumper::TransactionCanBeBumped(m_wallet.get(), txid); + return feebumper::TransactionCanBeBumped(*m_wallet.get(), txid); } bool createBumpTransaction(const uint256& txid, const CCoinControl& coin_control, @@ -255,17 +255,17 @@ public: return feebumper::CreateTotalBumpTransaction(m_wallet.get(), txid, coin_control, total_fee, errors, old_fee, new_fee, mtx) == feebumper::Result::OK; } else { - return feebumper::CreateRateBumpTransaction(m_wallet.get(), txid, coin_control, errors, old_fee, new_fee, mtx) == + return feebumper::CreateRateBumpTransaction(*m_wallet.get(), txid, coin_control, errors, old_fee, new_fee, mtx) == feebumper::Result::OK; } } - bool signBumpTransaction(CMutableTransaction& mtx) override { return feebumper::SignTransaction(m_wallet.get(), mtx); } + bool signBumpTransaction(CMutableTransaction& mtx) override { return feebumper::SignTransaction(*m_wallet.get(), mtx); } bool commitBumpTransaction(const uint256& txid, CMutableTransaction&& mtx, std::vector<std::string>& errors, uint256& bumped_txid) override { - return feebumper::CommitTransaction(m_wallet.get(), txid, std::move(mtx), errors, bumped_txid) == + return feebumper::CommitTransaction(*m_wallet.get(), txid, std::move(mtx), errors, bumped_txid) == feebumper::Result::OK; } CTransactionRef getTx(const uint256& txid) override |