aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2022-04-06 14:02:04 +0200
committerlaanwj <126646+laanwj@users.noreply.github.com>2022-04-06 14:05:52 +0200
commitbbb83f0b2b2671980c06453fd243b1f2801a1cc4 (patch)
tree725412325cc2270fad75ba7fca88691a0edd8b3f
parent6c9460edaeb6c89692b71f51be7b7ee386f4f5c4 (diff)
parent9d65ad365c539557e969a35d22723d92e0b422fe (diff)
Merge bitcoin/bitcoin#24145: mempool: Clear vTxHashes when mapTx is cleared
9d65ad365c539557e969a35d22723d92e0b422fe 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 9d65ad365c539557e969a35d22723d92e0b422fe Tree-SHA512: 6832755e43ab7f528b46817aeadcb6ffdc965b97f59ab96bb053dedbb7e68155ba3db52286355dca33b509237f80eda249760b26db493762bc50d8e2cef16d8f
-rw-r--r--src/txmempool.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index a480eb038d..f73cc5da5f 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -694,6 +694,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
void CTxMemPool::_clear()
{
+ vTxHashes.clear();
mapTx.clear();
mapNextTx.clear();
totalTxSize = 0;