Add fee option to fundrawtransaction #7857

pull promag wants to merge 4 commits into bitcoin:master from uphold:enhancement/add-fee-to-fundrawtransaction changing 7 files +215 −42
  1. promag commented at 7:25 AM on April 11, 2016: member

    Depends on #7518.

    Currently there is a dynamic/minimum fee determination when the transaction is constructed. This PR adds the fee option to fundrawtransaction for when the caller wants to specify an already determined fee by other means.

    Note that this is rebased with #7518 so only consider the last commit.

  2. promag force-pushed on Apr 11, 2016
  3. promag commented at 7:31 AM on April 11, 2016: member

    Will add tests when this is considered acceptable.

  4. promag renamed this:
    Add fee to fundrawtransaction
    Add fee option to fundrawtransaction
    on Apr 11, 2016
  5. jonasschnelli commented at 8:45 AM on April 11, 2016: contributor

    Concept ACK. The RBF feebump command requires a similar change.

  6. Add strict flag to RPCTypeCheckObj
    Strict flag forces type check on all object keys.
    f7dc1d32bb
  7. Add change options to fundrawtransaction db992eadbc
  8. Add lockUnspents option to fundrawtransaction 18be394cd8
  9. Add fee option to fundrawtransaction 7e658ddf23
  10. promag force-pushed on Apr 11, 2016
  11. laanwj added the label RPC/REST/ZMQ on Apr 11, 2016
  12. sdaftuar commented at 1:53 PM on April 11, 2016: member

    Wouldn't feerate make more sense to specify, since presumably you don't know how big the transaction will be?

  13. sipa commented at 2:17 PM on April 11, 2016: member

    I agree that feerate makes more sense. When you're calling fundrawtransaction, you don't know what the final inputs (and sometimes outputs) will be, or you wouldn't be calling it.

  14. promag commented at 2:48 PM on April 11, 2016: member

    Suppose the use case where the fee was estimated, rounded, displayed and accepted by the user. I just want to honour that value. If it is not enough then if fails, but if it succeeds then its added to the block reward.

    I'm aware of transaction size and all, but at the end I just need to fund the requested fee.

  15. jonasschnelli commented at 2:49 PM on April 11, 2016: contributor

    @promag: how about using CoinControls nMinimumTotalFee for that purpose?

  16. promag commented at 3:04 PM on April 11, 2016: member

    As I said, I have to honour that value and still use the unspent selection algorithm. There is no nMaximumTotalFee otherwise I would be happy.

  17. promag commented at 3:12 PM on April 11, 2016: member

    Unless you (all) agree on adding nMaximumTotalFee and fail if it's not enough.

  18. promag commented at 3:24 PM on April 15, 2016: member

    Since #7518 was merged, can I get some closure here?

  19. laanwj commented at 3:45 PM on April 15, 2016: member

    We try to avoid absolute fees on the API, because they make it easy to accidentally post a transaction with too little (or too much) fee. Especially for a call like fundrawtransaction, where, as said by @sdaftuar and @sipa, the final size of the transaction is not yet known. A fee rate would be better IMO.

  20. promag commented at 3:49 PM on April 15, 2016: member

    @laanwj even nMaximumTotalFee?

  21. laanwj commented at 4:20 PM on April 15, 2016: member

    If it is not enough then if fails, but if it succeeds then its added to the block reward.\ If it is not enough then if fails, but if it succeeds then its added to the block reward.**

    But when would it fail? You mean when it would be rejected by local mempool policy (note that this can vary quite much over time)?

  22. promag commented at 11:40 PM on April 15, 2016: member

    @laanwj nMaximumTotalFee would be added to CCoinControl and only used in CWallet::CreateTransaction. This is useful for services depending on bitcoind wishing to create transactions and have control of the final fee.

    Edit: This is not related to the mempool policy as it remains the same and it is a different subject.

  23. laanwj commented at 1:43 PM on April 19, 2016: member

    I still don't see the point. Why would you specify a maximum fee instead of a fee-rate? Before calling fundrawtransaction you don't know how large the transaction is going to be, and miners judge fee-rate (fee/KB), not total fee, so it's easy to get a transaction stuck this way.

  24. MarcoFalke commented at 1:52 PM on April 19, 2016: member

    Agree with @laanwj. Even though we have a -maxtxfee as some upper bound which ideally should never trigger, adding something like this as an option to fundraw does not make sense. You can look at the transaction later to find out the total fee and discard it/do other things if you don't like the fee amount.

  25. laanwj commented at 1:57 PM on April 19, 2016: member

    You can look at the transaction later to find out the total fee and discard it/do other things if you don't like the fee amount

    Right, that's one of the things you get for free with using a multi-step process instead of a single sendtoaddress.

  26. promag commented at 8:51 AM on April 22, 2016: member

    Imagine there are lots of small unspents that if used causes the total fee to increase. If lockUnspent option is true and fee exceeds the max fee then no locking would occur.

    Regardless of maxFee, I believe exposing the minFee (of CCoinControl) and allowing to override nTxConfirmTarget is acceptable?

  27. paveljanik commented at 10:47 AM on April 22, 2016: contributor

    Needs rebase.

  28. sipa commented at 2:35 PM on June 2, 2016: member

    Concept ACK for a maxfee. I don't think fundrawtransaction should have an exact fee option though.

    Also needs a rebase after #7518.

  29. promag commented at 8:51 PM on June 6, 2016: member

    I'm going forward with maxfee.

  30. sipa commented at 12:03 PM on August 25, 2016: member

    @promag Still working on this?

  31. laanwj commented at 12:43 PM on September 26, 2016: member

    Closing this due to inactivity, no reply from author in a month. Feel free to ping me if you're starting work on this again then I'll reopen.

  32. laanwj closed this on Sep 26, 2016

  33. jonasschnelli commented at 12:46 PM on September 26, 2016: contributor

    Related: #7967 ([merged] [RPC] add feerate option to fundrawtransaction)

  34. DrahtBot 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: 2026-04-13 15:15 UTC

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