Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 1,296 Lines • ▼ Show 20 Lines | SaltedTxidHasher::SaltedTxidHasher() | ||||
: k0(GetRand(std::numeric_limits<uint64_t>::max())), | : k0(GetRand(std::numeric_limits<uint64_t>::max())), | ||||
k1(GetRand(std::numeric_limits<uint64_t>::max())) {} | k1(GetRand(std::numeric_limits<uint64_t>::max())) {} | ||||
/** Maximum bytes for transactions to store for processing during reorg */ | /** Maximum bytes for transactions to store for processing during reorg */ | ||||
static const size_t MAX_DISCONNECTED_TX_POOL_SIZE = 20 * DEFAULT_MAX_BLOCK_SIZE; | static const size_t MAX_DISCONNECTED_TX_POOL_SIZE = 20 * DEFAULT_MAX_BLOCK_SIZE; | ||||
void DisconnectedBlockTransactions::addForBlock( | void DisconnectedBlockTransactions::addForBlock( | ||||
const std::vector<CTransactionRef> &vtx) { | const std::vector<CTransactionRef> &vtx) { | ||||
for (const auto &tx : vtx) { | for (const auto &tx : boost::adaptors::reverse(vtx)) { | ||||
// If we already added it, just skip. | // If we already added it, just skip. | ||||
auto it = queuedTx.find(tx->GetId()); | auto it = queuedTx.find(tx->GetId()); | ||||
if (it != queuedTx.end()) { | if (it != queuedTx.end()) { | ||||
continue; | continue; | ||||
} | } | ||||
// Insert the transaction into the pool. | // Insert the transaction into the pool. | ||||
addTransaction(tx); | addTransaction(tx); | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |