Skip to content

Commit bf663f8

Browse files
committed
remove external usage of mempool conflict tracking
1 parent 7d5d449 commit bf663f8

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

src/test/mempool_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ BOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)
412412
/* after tx6 is mined, tx7 should move up in the sort */
413413
std::vector<CTransactionRef> vtx;
414414
vtx.push_back(MakeTransactionRef(tx6));
415-
pool.removeForBlock(vtx, 1, NULL, false);
415+
pool.removeForBlock(vtx, 1);
416416

417417
sortedOrder.erase(sortedOrder.begin()+1);
418418
sortedOrder.pop_back();

src/txmempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::vector<CTransactio
597597
* Called when a block is connected. Removes from mempool and updates the miner fee estimator.
598598
*/
599599
void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight,
600-
std::vector<CTransactionRef>* conflicts, bool fCurrentEstimate)
600+
bool fCurrentEstimate)
601601
{
602602
LOCK(cs);
603603
std::vector<CTxMemPoolEntry> entries;
@@ -617,7 +617,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
617617
stage.insert(it);
618618
RemoveStaged(stage, true);
619619
}
620-
removeConflicts(*tx, conflicts);
620+
removeConflicts(*tx);
621621
ClearPrioritisation(tx->GetHash());
622622
}
623623
// After the txs in the new block have been removed from the mempool, update policy estimates

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class CTxMemPool
531531
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);
532532
void removeConflicts(const CTransaction &tx, std::vector<CTransactionRef>* removed = NULL);
533533
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight,
534-
std::vector<CTransactionRef>* conflicts = NULL, bool fCurrentEstimate = true);
534+
bool fCurrentEstimate = true);
535535
void clear();
536536
void _clear(); //lock free
537537
bool CompareDepthAndScore(const uint256& hasha, const uint256& hashb);

src/validation.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,11 +2153,10 @@ static int64_t nTimeChainState = 0;
21532153
static int64_t nTimePostConnect = 0;
21542154

21552155
/**
2156-
* Used to track conflicted transactions removed from mempool and transactions
2157-
* applied to the UTXO state as a part of a single ActivateBestChainStep call.
2156+
* Used to track blocks whose transactions were applied to the UTXO state as a
2157+
* part of a single ActivateBestChainStep call.
21582158
*/
21592159
struct ConnectTrace {
2160-
std::vector<CTransactionRef> txConflicted;
21612160
std::vector<std::pair<CBlockIndex*, std::shared_ptr<const CBlock> > > blocksConnected;
21622161
};
21632162

@@ -2208,7 +2207,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
22082207
int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4;
22092208
LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001);
22102209
// Remove conflicting transactions from the mempool.;
2211-
mempool.removeForBlock(blockConnecting.vtx, pindexNew->nHeight, &connectTrace.txConflicted, !IsInitialBlockDownload());
2210+
mempool.removeForBlock(blockConnecting.vtx, pindexNew->nHeight, !IsInitialBlockDownload());
22122211
// Update chainActive & related variables.
22132212
UpdateTip(pindexNew, chainparams);
22142213

@@ -2433,11 +2432,6 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
24332432

24342433
// throw all transactions though the signal-interface
24352434
// while _not_ holding the cs_main lock
2436-
for (const auto& tx : connectTrace.txConflicted)
2437-
{
2438-
GetMainSignals().SyncTransaction(*tx, pindexNewTip, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
2439-
}
2440-
// ... and about transactions that got confirmed:
24412435
for (const auto& pair : connectTrace.blocksConnected) {
24422436
assert(pair.second);
24432437
const CBlock& block = *(pair.second);

0 commit comments

Comments
 (0)