This is a minor optimization where mapNextTx can instead use lower_bound instead of calling find. I think lower_bound and increment should be more efficient compared to N find calls, plus the loop will exit early if there are no more entries in the map for the prevout hash which wasn't the case previously.
mempool: use mapNextTx.lower_bound in removeRecursive #24926
pull Crypt-iQ wants to merge 1 commits into bitcoin:master from Crypt-iQ:mapnexttx_04192022 changing 1 files +3 −5-
Crypt-iQ commented at 9:11 PM on April 19, 2022: contributor
-
mempool: use mapNextTx.lower_bound in removeRecursive f4277110f7
- DrahtBot added the label Mempool on Apr 19, 2022
-
fanquake commented at 1:37 PM on May 12, 2022: member
This is a minor optimization ... I think lower_bound and increment should be more efficient compared to N find calls
Can you provide a benchmark?
- Crypt-iQ closed this on Jun 3, 2022
- DrahtBot locked this on Jun 3, 2023