-maxtxfee is used as a fee and a feerate #29220

issue glozow openend this issue on January 10, 2024
  1. glozow commented at 5:56 pm on January 10, 2024: member

    The -maxtxfee (which is put into m_default_max_tx_fee) is documented as “the maximum total fees to use in a single wallet transaction” https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/wallet/init.cpp#L63

    This seems true in many instances when we look at the code: https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/wallet/spend.cpp#L1293-L1295 https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/wallet/feebumper.cpp#L114-L119 https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/node/transaction.cpp#L71-L79

    But there are also places where this value is used as a feerate per KvB: https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/wallet/wallet.cpp#L3061-L3064 https://github.com/bitcoin/bitcoin/blob/632a2bb731804dffe52bd4cbd90bfee352d25ede/src/wallet/rpc/spend.cpp#L433

    I don’t think these instances of conversions to feerate result in anything very problematic, but it doesn’t make sense to just convert this fee to a feerate because not every tx is the same size. I can see why a wallet user might want a maximum fee and maximum feerate. So my suggested solution is to have both: add a -maxfeerate and put those checks under the new value.

  2. glozow added the label Wallet on Jan 10, 2024
  3. glozow commented at 8:13 pm on January 10, 2024: member
    This was partially motivated by seeing #29217, as I thought “don’t we already have a max feerate?” and realized it was a max absolute fee.
  4. bitcoin deleted a comment on Jan 14, 2024


glozow

Labels
Wallet


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-06-29 07:13 UTC

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