diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-07-29 10:41:42 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-09-07 13:04:02 -0400 |
commit | faa1a749428a195af784633eb78e1df5d6a0e875 (patch) | |
tree | f3daeda06c5e1d50f177e2bfd7580161f25ff359 /src/txmempool.h | |
parent | 4799b0932a10c5a48706700a07899b33ef9c8bae (diff) | |
download | bitcoin-faa1a749428a195af784633eb78e1df5d6a0e875.tar.xz |
tx pool: Use class methods to hide raw map iterator impl details
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index 2163b5eb21..913501fd66 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -566,7 +566,15 @@ public: void ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const; void ClearPrioritisation(const uint256 hash); -public: + /** Get the transaction in the pool that spends the same prevout */ + const CTransaction* GetConflictTx(const COutPoint& prevout) const EXCLUSIVE_LOCKS_REQUIRED(cs); + + /** Returns an iterator to the given hash, if found */ + boost::optional<txiter> GetIter(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs); + + /** Translate a set of hashes into a set of pool iterators to avoid repeated lookups */ + setEntries GetIterSet(const std::set<uint256>& hashes) const EXCLUSIVE_LOCKS_REQUIRED(cs); + /** Remove a set of transactions from the mempool. * If a transaction is in this set, then all in-mempool descendants must * also be in the set, unless this transaction is being removed for being @@ -639,7 +647,7 @@ public: return totalTxSize; } - bool exists(uint256 hash) const + bool exists(const uint256& hash) const { LOCK(cs); return (mapTx.count(hash) != 0); |