Fix a bug if the min fee is 0 for FeeFilterRounder #9288

pull morcos wants to merge 2 commits into bitcoin:master from morcos:fixFFRbug changing 3 files +4 −3
  1. morcos commented at 2:52 am on December 6, 2016: member
    Thanks @dcousens and @gmaxwell
  2. gmaxwell commented at 2:57 am on December 6, 2016: contributor
    ACK. This appears sensible and also fixes the bug.
  3. dcousens commented at 3:13 am on December 6, 2016: contributor

    ACK 0e78469, does it need to be put in place at https://github.com/bitcoin/bitcoin/blob/master/src/policy/fees.cpp#L304 also?

    Probably not, since that is bounded by MIN_FEERATE

    Actually, probably is worth it since if someone changed MIN_FEERATE to 0, it would dead lock again.

  4. laanwj commented at 8:56 am on December 6, 2016: member
    utACK 0e78469
  5. MarcoFalke commented at 10:57 am on December 6, 2016: member

    if someone changed MIN_FEERATE to 0

    I think we can’t protect against developers randomly changing internal constants.

    utACK 0e78469

  6. sipa commented at 5:08 pm on December 6, 2016: member
    @dcousens One way to deal with such constraints that some parts of the code have, is by adding a static_assert(MIN_FEERATE > 0, "Min feerate must be nonzero); in the place where it is used.
  7. dcousens commented at 10:16 pm on December 6, 2016: contributor
    @sipa sounds fine to me
  8. fanquake added the label TX fees and policy on Dec 8, 2016
  9. laanwj commented at 7:34 am on December 8, 2016: member
    Yes, static assertions would be the way to go then.
  10. morcos force-pushed on Dec 8, 2016
  11. morcos commented at 2:19 pm on December 8, 2016: member

    I added the static_assert, although I’m not sure it matters since the value used is actually max of MIN_FEERATE and minRelayTxFee which can’t be 0. But it doesn’t hurt.

    I noticed another “bug” if a minRelayTxFee of 1 satoshi is used in the mempool min fee decay. Wouldn’t mind someone else verifying the fix makes sense though..

  12. fix a bug if the min fee is 0 for FeeFilterRounder eab8e1b172
  13. Avoid rollingMinimumFeeRate never being able to decay below half f8d43b8081
  14. morcos force-pushed on Dec 8, 2016
  15. gmaxwell commented at 11:03 pm on December 12, 2016: contributor
    re-ACK.
  16. laanwj commented at 11:28 am on January 4, 2017: member
    utACK f8d43b8
  17. laanwj merged this on Jan 4, 2017
  18. laanwj closed this on Jan 4, 2017

  19. laanwj referenced this in commit 1ce7ede2a9 on Jan 4, 2017
  20. codablock referenced this in commit bdd151f598 on Jan 18, 2018
  21. andvgal referenced this in commit eb7947e9ca on Jan 6, 2019
  22. CryptoCentric referenced this in commit 502d1ca720 on Feb 26, 2019
  23. Fuzzbawls referenced this in commit 71ed429370 on Feb 14, 2021
  24. 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: 2024-12-18 21:12 UTC

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