Fix mempool packages #6715

pull sdaftuar wants to merge 2 commits into bitcoin:master from sdaftuar:fix-mempool-packages changing 3 files +121 −27
  1. sdaftuar commented at 6:47 PM on September 23, 2015: member

    This fixes an edge case (introduced by #6654 and reported by @sipa here: #6654 (comment)) in removing an entry from the mempool during the middle of a reorg, where the entry has an in-block ancestor which has not yet had its descendant state updated for the transaction being removed.

    The first commit updates the mempool_packages.py rpc-test to include a test that demonstrates the bug; the second commit provides a fix.

  2. laanwj added the label Bug on Sep 23, 2015
  3. Add test showing bug in mempool packages 598b25d5ee
  4. sdaftuar force-pushed on Sep 23, 2015
  5. Fix mempool package tracking edge case
    CalculateMemPoolAncestors was always looping over a transaction's inputs
    to find in-mempool parents.  When adding a new transaction, this is the
    correct behavior, but when removing a transaction, we want to use the
    ancestor set that would be calculated by walking mapLinks (which should
    in general be the same set, except during a reorg when the mempool is
    in an inconsistent state, and the mapLinks-based calculation would be the
    correct one).
    60de0d5826
  6. sdaftuar force-pushed on Sep 23, 2015
  7. morcos commented at 8:38 PM on September 23, 2015: member

    ACK

  8. btcdrak commented at 10:59 PM on September 23, 2015: contributor

    utACK

  9. 0x9F commented at 6:46 AM on September 24, 2015: none

    Tested. Passes in a previously crashing situation.

  10. laanwj merged this on Sep 24, 2015
  11. laanwj closed this on Sep 24, 2015

  12. laanwj referenced this in commit 82d2aef7b3 on Sep 24, 2015
  13. laanwj commented at 10:26 AM on September 24, 2015: member

    utACK

  14. random-zebra referenced this in commit 6bc917e859 on Jul 6, 2020
  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 12:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me