From 811902649d6aaddd886cb39b83aa69adf7b441bd Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 14 Jun 2016 23:59:03 -0700 Subject: Provide a flat list of txid/terators to txn in CTxMemPool --- src/txmempool.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/txmempool.h') diff --git a/src/txmempool.h b/src/txmempool.h index f0e9b2e2c6..d6d0d72ff5 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -150,6 +150,8 @@ public: uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; } CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; } unsigned int GetSigOpCountWithAncestors() const { return nSigOpCountWithAncestors; } + + mutable size_t vTxHashesIdx; //!< Index in mempool's vTxHashes }; // Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index. @@ -457,7 +459,10 @@ public: mutable CCriticalSection cs; indexed_transaction_set mapTx; + typedef indexed_transaction_set::nth_index<0>::type::iterator txiter; + std::vector > vTxHashes; //!< All tx hashes/entries in mapTx, in random order + struct CompareIteratorByHash { bool operator()(const txiter &a, const txiter &b) const { return a->GetTx().GetHash() < b->GetTx().GetHash(); -- cgit v1.2.3