Closed yyforyongyu closed 1 year ago
IMO only the first two commits should go in 0.17. The other commits would take more review time than I have and aren't as critical as the memory leak fix.
You mean the first three? The redundant Add
needs to be removed otherwise the mempool will keep growing between polling intervals.
Updated the PR to focus on the memory leak fix. The last commit adds a unit test to check that the mempool state is updated as expected, and the only change is the newly added interface so I think it belongs here. cc @Crypt-iQ
Previously when adding a replacement tx to the local mempool, when the txid's nested map becomes empty, we forgot to delete the key from the root map. And when adding the same tx to the
txids
map(which happens in ZMQ), we may treat the tx as a replacement tx. These are now fixed and the related unit tests are added/updated to reflect the fix.