MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ReScanMemPoolTx

Method ReScanMemPoolTx

src/tx/txmempool.cpp:139–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void CTxMemPool::ReScanMemPoolTx() {
140 auto bm = MAKE_BENCHMARK("rescan all tx in mempool");
141 cw.reset(new CCacheWrapper(pCdMan));
142
143 LOCK(cs);
144 CValidationState state;
145 int index = 0;
146 for (map<uint256, CTxMemPoolEntry>::iterator iterTx = memPoolTxs.begin(); iterTx != memPoolTxs.end(); ++index) {
147 if (!CheckTxInMemPool(iterTx->first, iterTx->second, state, index, true)) {
148 uint256 txid = iterTx->first;
149 iterTx = memPoolTxs.erase(iterTx++);
150 EraseTransactionFromWallet(txid);
151 continue;
152 }
153 ++iterTx;
154 }
155}
156
157void CTxMemPool::Clear() {
158 LOCK(cs);

Callers 3

ConnectBlockOnFinChainFunction · 0.80
ActivateBestChainFunction · 0.80
droptxfrommempoolFunction · 0.80

Calls 5

resetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected