Unexpected -maxtxfee behavior #10122

issue Celean openend this issue on March 30, 2017
  1. Celean commented at 3:06 pm on March 30, 2017: none

    The documentation for -maxtxfee seems to imply that it will abort a transaction if the transaction’s fee is larger than the specified amount. The actual behavior is to just use a fee equal to maxtxfee when the calculated fee is larger.

    -maxtxfee= Maximum total fees (in BTC) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: 0.10)

    In a specific case I observed, a large transaction created with sendtransaction and paytxfee 0.0012 ended up being broadcast with a fee of 15 sat/byte rather than aborted, which seems unintuitive.

    However, looking at https://github.com/bitcoin/bitcoin/blob/master/src/wallet/wallet.cpp#L2747 in CWallet::GetMinimumFee this seems intended, and as far as I can tell, the only situation where a transaction will be aborted is if if the fee is below minrelaytxfee, rather than paytxfee.

    Is this really the intended behavior? I feel like it would make far more sense that, if paytxfee is set explicitly, the transaction should be aborted if maxtxfee causes the calculated fee to drop below that value.

    If not, I would argue that at the very least, the documentation for this setting should refer to the minrelaytxfee threshold specifically.

  2. jonasschnelli added the label TX fees and policy on Mar 30, 2017
  3. jonasschnelli added the label Wallet on Mar 30, 2017
  4. jnewbery commented at 12:50 pm on April 7, 2017: member

    I believe we won’t broadcast any transaction with fees > maxtxfee, because they won’t be admitted to our mempool (all calls to AcceptToMemoryPool() in the wallet use maxTxFee, which gets set from the -maxtxfee argument here: https://github.com/bitcoin/bitcoin/blob/8c28670e92b6422eb7576f074446238f9f221999/src/wallet/wallet.cpp#L3918).

    I can’t comment on the specific case you observed, since you haven’t included details about the total fee attached to the transaction. Note that -mxtxfee is limiting the total fee, not the fee rate. paytxfee, on the other hand, sets the feerate in BTC per kB.

  5. MarcoFalke commented at 1:26 pm on April 7, 2017: member

    Indeed, there is a belt and suspender check in ATMP that rejects any transactions with fees larger than nAbsurdFee (==maxTxFee for the wallet). Additionally, it is wanted that the wallet does not create transactions that would be rejected by the mempool, so capping the total fee to maxTxFee makes sense. I’d suggest to update the documentation for -maxtxfee.

    On Fri, Apr 7, 2017 at 2:51 PM, John Newbery notifications@github.com wrote:

    I believe we won’t broadcast any transaction with fees > maxtxfee, because they won’t be admitted to our mempool (all calls to AcceptToMemoryPool() in the wallet use maxTxFee, which gets set from the -maxtxfee argument here: https://github.com/bitcoin/bitcoin/blob/ 8c28670e92b6422eb7576f074446238f9f221999/src/wallet/wallet.cpp#L3918).

    I can’t comment on the specific case you observed, since you haven’t included details about the total fee attached to the transaction. Note that -mxtxfee is limiting the total fee, not the fee rate. paytxfee, on the other hand, sets the feerate in BTC per kB.

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/10122#issuecomment-292527860, or mute the thread https://github.com/notifications/unsubscribe-auth/AGGmvwW6Cp_JDp8ZpnJr5Y4dT8UCi8y3ks5rtjE6gaJpZM4Mufxp .

  6. Celean commented at 10:33 pm on April 7, 2017: none

    Capping transactions to maxtxfee is all well and good, but the unexpected part was the transaction being broadcast with a very low (capped) fee despite the “setting this too low may abort large transactions” wording. I believe the transaction in question was in the ~60 KB range and hit the 0.01 limit configured for that wallet, leaving the fee at ~15 sat/byte.

    My suggestion is that it would make sense if a transaction is aborted (i.e. not broadcast) if maxtxfee ends up capping the fee to less than paytxfee, as that could indicate a problem. I assume a setting like this is intended as a safeguard against fat-fingered or erroneously calculated fees, but right now with the default setting, it would just limit the fee to ~$120 at today’s rate.

  7. Leviathn commented at 5:35 am on September 12, 2017: none
    Is this still the case in .15 @celean? I think the transaction fee logic and coin-selection upgrades should have resolved this..
  8. MarcoFalke commented at 8:12 pm on March 23, 2018: member

    Yes, this is still the case. I’d assume you can read the FeeReason and abort if it is set to MAXTXFEE?

    https://github.com/bitcoin/bitcoin/blob/cead84b72d27517338ac3c49eaaed4db07352f41/src/wallet/fees.cpp#L28

  9. MarcoFalke added the label Up for grabs on Dec 23, 2018
  10. MarcoFalke added this to the milestone 0.19.0 on Mar 19, 2019
  11. MarcoFalke added the label Bug on Mar 19, 2019
  12. MarcoFalke removed the label Bug on Mar 19, 2019
  13. Sjors commented at 1:41 am on June 21, 2019: member
    Fixed in #16257
  14. MarcoFalke removed the label Up for grabs on Jun 30, 2019
  15. MarcoFalke removed this from the milestone 0.19.0 on Jun 30, 2019
  16. MarcoFalke added this to the milestone 0.18.1 on Jul 2, 2019
  17. MarcoFalke commented at 12:04 pm on July 10, 2019: member
    This will be fixed in 0.18.1
  18. MarcoFalke closed this on Jul 10, 2019

  19. MarcoFalke 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: 2024-12-18 21:12 UTC

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