aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-03-08 12:15:42 -0500
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-06-11 19:04:55 +0900
commit475a385a80198a46a6d99846f99b968f04e9b470 (patch)
tree90b792ecd5f336c4f7c35051f6d90060348ea004 /src/txmempool.h
parent46847d69d2c1cc908fd779daac7884e365955dbd (diff)
downloadbitcoin-475a385a80198a46a6d99846f99b968f04e9b470.tar.xz
Add GetTransactionAncestry to CTxMemPool for general purpose chain limit checking
Diffstat (limited to 'src/txmempool.h')
-rw-r--r--src/txmempool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index b60c2c50b1..d32c29a18f 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -620,6 +620,12 @@ public:
/** Expire all transaction (and their dependencies) in the mempool older than time. Return the number of removed transactions. */
int Expire(int64_t time);
+ /**
+ * Calculate the ancestor and descendant count for the given transaction.
+ * The counts include the transaction itself.
+ */
+ void GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) const;
+
/** Returns false if the transaction is in the mempool and not within the chain limit specified. */
bool TransactionWithinChainLimit(const uint256& txid, size_t ancestor_limit, size_t descendant_limit) const;