From f14ebdde8e146b4b85243ce8bb190f0eaa3e0f3c Mon Sep 17 00:00:00 2001 From: Andres Correa Casablanca Date: Wed, 16 Jan 2019 14:32:52 +0100 Subject: [PATCH] Avoid using Boost adaptors::reverse Signed-off-by: Andres Correa Casablanca --- src/txmempool.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index f20d7158a4..2ee0d35e6c 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -5,7 +5,6 @@ #include -#include #include #include #include @@ -569,11 +568,11 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigne DisconnectedBlockTransactions disconnectpool; disconnectpool.addForBlock(vtx); - for (const CTransactionRef &tx : boost::adaptors::reverse( - disconnectpool.GetQueuedTx().get() - ) - ) { - uint256 hash = tx->GetHash(); + auto begin_it = disconnectpool.GetQueuedTx().get().rbegin(); + auto end_it = disconnectpool.GetQueuedTx().get().rend(); + + for (auto ptx = begin_it; ptx != end_it; ptx++) { + uint256 hash = (*ptx)->GetHash(); indexed_transaction_set::iterator i = mapTx.find(hash); if (i != mapTx.end()) { @@ -587,10 +586,8 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigne minerPolicyEstimator->processBlock(nBlockHeight, entries); } - for (const CTransactionRef &tx : boost::adaptors::reverse( - disconnectpool.GetQueuedTx().get() - ) - ) { + for (auto ptx = begin_it; ptx != end_it; ptx++) { + auto tx = *ptx; txiter it = mapTx.find(tx->GetHash()); if (it != mapTx.end()) { setEntries stage;