Skip to content

Commit

Permalink
Avoid using Boost adaptors::reverse
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Correa Casablanca <andres@thirdhash.com>
  • Loading branch information
Andres Correa Casablanca committed Jan 17, 2019
1 parent 2215236 commit f14ebdd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <txmempool.h>

#include <boost/range/adaptor/reversed.hpp>
#include <consensus/consensus.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
Expand Down Expand Up @@ -569,11 +568,11 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
DisconnectedBlockTransactions disconnectpool;
disconnectpool.addForBlock(vtx);

for (const CTransactionRef &tx : boost::adaptors::reverse(
disconnectpool.GetQueuedTx().get<insertion_order>()
)
) {
uint256 hash = tx->GetHash();
auto begin_it = disconnectpool.GetQueuedTx().get<insertion_order>().rbegin();
auto end_it = disconnectpool.GetQueuedTx().get<insertion_order>().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()) {
Expand All @@ -587,10 +586,8 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
minerPolicyEstimator->processBlock(nBlockHeight, entries);
}

for (const CTransactionRef &tx : boost::adaptors::reverse(
disconnectpool.GetQueuedTx().get<insertion_order>()
)
) {
for (auto ptx = begin_it; ptx != end_it; ptx++) {
auto tx = *ptx;
txiter it = mapTx.find(tx->GetHash());
if (it != mapTx.end()) {
setEntries stage;
Expand Down

0 comments on commit f14ebdd

Please sign in to comment.