Skip to content

Commit bbb83f0

Browse files
committed
Merge bitcoin/bitcoin#24145: mempool: Clear vTxHashes when mapTx is cleared
9d65ad3 Clear vTxHashes when mapTx is cleared (Peter Bushnell) Pull request description: vTxHashes is a vector of all entries in mapTx, if you clear one you should clear the other, lest someone try to use the txiter in vTxHashes which would result in a segfault. ACKs for top commit: laanwj: Code review ACK 9d65ad3 Tree-SHA512: 6832755e43ab7f528b46817aeadcb6ffdc965b97f59ab96bb053dedbb7e68155ba3db52286355dca33b509237f80eda249760b26db493762bc50d8e2cef16d8f
2 parents 6c9460e + 9d65ad3 commit bbb83f0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
694694

695695
void CTxMemPool::_clear()
696696
{
697+
vTxHashes.clear();
697698
mapTx.clear();
698699
mapNextTx.clear();
699700
totalTxSize = 0;

0 commit comments

Comments
 (0)