diff options
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/chain.cpp | 4 | ||||
| -rw-r--r-- | src/interfaces/chain.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 8c5921970..d7bad0543 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -196,6 +196,10 @@ public: auto it_mp = ::mempool.mapTx.find(txid); return it_mp != ::mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1; } + void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) override + { + ::mempool.GetTransactionAncestry(txid, ancestors, descendants); + } }; } // namespace diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index aa4f17a8e..33bbfefd9 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -9,6 +9,7 @@ #include <policy/rbf.h> // For RBFTransactionState #include <memory> +#include <stddef.h> #include <stdint.h> #include <string> #include <vector> @@ -138,6 +139,9 @@ public: //! Check if transaction has descendants in mempool. virtual bool hasDescendantsInMempool(const uint256& txid) = 0; + + //! Calculate mempool ancestor and descendant counts for the given transaction. + virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0; }; //! Interface to let node manage chain clients (wallets, or maybe tools for |