Better GetHeight() for CTxMemPoolEntry #22996

pull rebroad wants to merge 2 commits into bitcoin:master from rebroad:BetterEntryHeight changing 9 files +80 −40
  1. rebroad commented at 12:30 PM on September 16, 2021: contributor

    This changes how block height of a transaction in the memory pool is obtained, so that instead of being stored in CTxMemPoolEntry, it is derived when asked for.

    This has a few advantages:-

    1. It reduces the memory usage of TxMemPoolEntry
    2. It allows the correct height to be used for transactions loaded from mempool.dat
    3. It allows the correct height to be used for transactions saved to the memory pool during initial block download.
    4. It therefore improves fee estimation given that correct values are being used.

    Disadvantages:-

    1. It requires access to the active chain by various functions that previously did not require access, and a lock on cs_main while doing this.

    Draft as still testing, but opening to request comments.

  2. Better fee estimation by identifying the correct height of transactions
    received during IBD, and from LoadMempool().
    
    Also allows CTxMemPoolEntry to be smaller by removing entryHeight.
    279168f075
  3. Remove redundant entryHeight from CTxMemPoolEntry 00bbac73b4
  4. rebroad closed this on Sep 16, 2021

  5. fanquake locked this on Sep 18, 2021
Contributors

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-22 18:14 UTC

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