GetFee should round up to avoid undershooting feerate #16500

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:fix_filter_mempool_mistmatch changing 2 files +8 −6
  1. instagibbs commented at 9:06 PM on July 30, 2019: member

    Currently fee filter and mempool/wallet will disagree on the sufficiency of minrelay fee transactions when the min relay rate is not % 1000 = 0. The wallet and mempool will allow a transaction to be created and entered into mempool, but then peers that have the same rate as a fee filter will not receive the transaction because of the undershooting that occurs in GetFee.

    Fixes https://github.com/bitcoin/bitcoin/issues/16499

  2. instagibbs commented at 9:09 PM on July 30, 2019: member

    This fix is conservative because almost everyone is running defaults of 1000 exactly.

    I haven't thought enough about whether transactions can get stranded with this update when runnin non-default arguments, but tightening this wallet/mempool logic seems prudent either way.

  3. fanquake added the label TX fees and policy on Jul 30, 2019
  4. promag commented at 12:47 AM on July 31, 2019: member

    ACK, could have a test that would fail without this change?

  5. promag commented at 12:31 PM on July 31, 2019: member

    Should update tests in test/amount_tests.cpp:44.

  6. GetFee should round up to avoid undershooting feerate e5b3874e9c
  7. instagibbs force-pushed on Jul 31, 2019
  8. instagibbs commented at 2:41 PM on July 31, 2019: member

    Fixed unit tests and the calculation for negative feerates(rounding down), though I'm unclear if that's ever used in anger.

    Working on a minimal test case...

  9. MarcoFalke commented at 3:15 PM on July 31, 2019: member

    Are you changing the definition of dust?

  10. instagibbs commented at 3:33 PM on July 31, 2019: member

    Closing as I think this change is actually touching too many things. Going to fix the relay issue more directly instead if possible.

  11. instagibbs closed this on Jul 31, 2019

  12. fanquake referenced this in commit 94d6a18f23 on Oct 4, 2019
  13. sidhujag referenced this in commit ec1754ad1a on Oct 4, 2019
  14. DrahtBot locked this on Dec 16, 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-17 09:14 UTC

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