From 288d85ddf2e0a0c9d25a23db56052883170466d0 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 7 Jun 2016 13:44:56 +0200 Subject: Get rid of CTxMempool::lookup() entirely --- src/txmempool.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/txmempool.cpp') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index d39c9577f2..205ffd6379 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -831,16 +831,6 @@ std::shared_ptr CTxMemPool::get(const uint256& hash) const return i->GetSharedTx(); } -bool CTxMemPool::lookup(uint256 hash, CTransaction& result) const -{ - auto tx = get(hash); - if (tx) { - result = *tx; - return true; - } - return false; -} - TxMempoolInfo CTxMemPool::info(const uint256& hash) const { LOCK(cs); @@ -960,9 +950,9 @@ bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const { // If an entry in the mempool exists, always return that one, as it's guaranteed to never // conflict with the underlying cache, and it cannot have pruned entries (as it contains full) // transactions. First checking the underlying cache risks returning a pruned entry instead. - CTransaction tx; - if (mempool.lookup(txid, tx)) { - coins = CCoins(tx, MEMPOOL_HEIGHT); + shared_ptr ptx = mempool.get(txid); + if (ptx) { + coins = CCoins(*ptx, MEMPOOL_HEIGHT); return true; } return (base->GetCoins(txid, coins) && !coins.IsPruned()); -- cgit v1.2.3