Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.cpp
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, | ||||
nTransactionsUpdated++; | nTransactionsUpdated++; | ||||
totalTxSize += entry.GetTxSize(); | totalTxSize += entry.GetTxSize(); | ||||
vTxHashes.emplace_back(tx.GetHash(), newit); | vTxHashes.emplace_back(tx.GetHash(), newit); | ||||
newit->vTxHashesIdx = vTxHashes.size() - 1; | newit->vTxHashesIdx = vTxHashes.size() - 1; | ||||
} | } | ||||
void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) { | void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) { | ||||
// We increment mempool sequence value no matter removal reason | |||||
// even if not directly reported below. | |||||
uint64_t mempool_sequence = GetAndIncrementSequence(); | |||||
if (reason != MemPoolRemovalReason::BLOCK) { | if (reason != MemPoolRemovalReason::BLOCK) { | ||||
// Notify clients that a transaction has been removed from the mempool | // Notify clients that a transaction has been removed from the mempool | ||||
// for any reason except being included in a block. Clients interested | // for any reason except being included in a block. Clients interested | ||||
// in transactions included in blocks can subscribe to the | // in transactions included in blocks can subscribe to the | ||||
// BlockConnected notification. | // BlockConnected notification. | ||||
GetMainSignals().TransactionRemovedFromMempool(it->GetSharedTx(), | GetMainSignals().TransactionRemovedFromMempool( | ||||
reason); | it->GetSharedTx(), reason, mempool_sequence); | ||||
} | } | ||||
for (const CTxIn &txin : it->GetTx().vin) { | for (const CTxIn &txin : it->GetTx().vin) { | ||||
mapNextTx.erase(txin.prevout); | mapNextTx.erase(txin.prevout); | ||||
} | } | ||||
/* add logging because unchecked */ | /* add logging because unchecked */ | ||||
RemoveUnbroadcastTx(it->GetTx().GetId(), true); | RemoveUnbroadcastTx(it->GetTx().GetId(), true); | ||||
▲ Show 20 Lines • Show All 969 Lines • Show Last 20 Lines |