[RPC] add feerate option to fundrawtransaction #7967

pull jonasschnelli wants to merge 2 commits into bitcoin:master from jonasschnelli:2016/04/fund_fee changing 5 files +34 −6
  1. jonasschnelli commented at 8:07 PM on April 28, 2016: contributor

    Fixes #7963

    Currently fundrawtransaction always uses the default confirm target to estimate the fee (with a fallback to payTxFee).

    This PR adds an optional feeRate parameter to fundrawtransaction that overrides the estimated minimum fee.

  2. [RPC] add feerate option to fundrawtransaction 3b35e4896b
  3. jonasschnelli added the label Wallet on Apr 28, 2016
  4. jonasschnelli added the label RPC/REST/ZMQ on Apr 28, 2016
  5. Add more clear interface for CoinControl.h regarding individual feerate 04eaa90958
  6. in src/wallet/wallet.cpp:None in 3b35e4896b outdated
    2243 | @@ -2242,6 +2244,8 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
    2244 |                  if (coinControl && nFeeNeeded > 0 && coinControl->nMinimumTotalFee > nFeeNeeded) {
    2245 |                      nFeeNeeded = coinControl->nMinimumTotalFee;
    2246 |                  }
    2247 | +                if (coinControl && coinControl->nFeeRate > CFeeRate(0))
    2248 | +                    nFeeNeeded = coinControl->nFeeRate.GetFee(nBytes);
    


    laanwj commented at 10:56 AM on May 5, 2016:

    Concept ACK. Though should we be using '0' as a special marker value? What if you want to override it to 0? I think I'd prefer an explicit boolean 'overrideFeeRate'.


    jonasschnelli commented at 11:09 AM on May 5, 2016:

    Yes. We could use an extra boolean (like overrideFeeRate). My thoughts where that a CFeeRate(0) is not practical but I agree, it would technically be possible to use a zero feerate. I'll add the bool.

  7. jonasschnelli commented at 9:11 AM on May 6, 2016: contributor

    Added a commit that add an explicit boolean for overriding the estimated fee rate (overrideFeeRate). This would allow to use 0 as fee rate (zero fee transaction) but would require 0 as minRelayTxFee.

  8. sipa commented at 8:33 AM on May 17, 2016: member

    utACK 04eaa9095813b854c4299027c595fb9ebaf6f934

  9. laanwj commented at 1:37 PM on June 3, 2016: member

    utACK 04eaa90

  10. laanwj merged this on Jun 3, 2016
  11. laanwj closed this on Jun 3, 2016

  12. laanwj referenced this in commit 8c1e49ba13 on Jun 3, 2016
  13. in qa/rpc-tests/fundrawtransaction.py:None in 04eaa90958
     676 | @@ -677,6 +677,14 @@ def run_test(self):
     677 |          assert(signedtx["complete"])
     678 |          self.nodes[0].sendrawtransaction(signedtx["hex"])
     679 |  
     680 | +        inputs = []
     681 | +        outputs = {self.nodes[2].getnewaddress() : 1}
     682 | +        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)
     683 | +        result = self.nodes[3].fundrawtransaction(rawtx, )
    


    MarcoFalke commented at 4:02 PM on June 3, 2016:

    Nit: empty arg. Nit: Missing comment mentioning that min_relay_tx_fee=1000 is used.

    (Comments help to identify the issue when something breaks)

  14. in src/wallet/rpcwallet.cpp:None in 04eaa90958
    2457 | @@ -2458,6 +2458,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
    2458 |                              "     \"changePosition\"    (numeric, optional, default random) The index of the change output\n"
    2459 |                              "     \"includeWatching\"   (boolean, optional, default false) Also select inputs which are watch only\n"
    2460 |                              "     \"lockUnspents\"      (boolean, optional, default false) Lock selected unspent outputs\n"
    2461 | +                            "     \"feeRate\"           (numeric, optional, default 0=estimate) Set a specific feerate (fee per KB)\n"
    


    MarcoFalke commented at 4:02 PM on June 3, 2016:

    the default is not "estimate" but whatever happens to be set by the user on startup or after startup.

    Either make it default 0 or default not set.

  15. MarcoFalke commented at 4:03 PM on June 3, 2016: member

    Post merge utACK 04eaa90

  16. codablock referenced this in commit a07e0b6fdd on Sep 16, 2017
  17. codablock referenced this in commit 5182311839 on Sep 19, 2017
  18. codablock referenced this in commit c69df9b82c on Dec 22, 2017
  19. andvgal referenced this in commit f09433940b on Jan 6, 2019
  20. furszy referenced this in commit 0724bbbad2 on Jun 28, 2020
  21. 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: 2026-04-13 15:15 UTC

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