| 137 | } |
| 138 | |
| 139 | void 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 | |
| 157 | void CTxMemPool::Clear() { |
| 158 | LOCK(cs); |
no test coverage detected