Skip to content

Instantly share code, notes, and snippets.

@jonatack
Last active June 25, 2020 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonatack/f16e51274d4254c01f682063b0f89e04 to your computer and use it in GitHub Desktop.
Save jonatack/f16e51274d4254c01f682063b0f89e04 to your computer and use it in GitHub Desktop.
Notes from reviewing Bitcoin Core PR #11413 "[wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option" by kallewoof

Notes from reviewing Bitcoin Core PR #11413

"[wallet] [rpc] sendtoaddress/sendmany: Add explicit feerate option" by @kallewoof

bitcoin/bitcoin#11413


src/wallet/rpcwallet.cpp

Callers of static void SetFeeEstimateMode(const CWallet* pwallet, CCoinControl& cc, const UniValue& estimate_mode, const UniValue& estimate_param)

static UniValue sendtoaddress()

470 SetFeeEstimateMode(pwallet, coin_control, request.params[7], request.params[6]);

static UniValue sendmany()

861 SetFeeEstimateMode(pwallet, coin_control, request.params[7], request.params[6]);

static UniValue bumpfee()

3335 SetFeeEstimateMode(pwallet, coin_control, options["estimate_mode"], conf_target);

void FundTransaction()

3021 SetFeeEstimateMode(pwallet, coinControl, options["estimate_mode"], options["conf_target"])

Callers of void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& fee_out, int& change_position, UniValue options)

static UniValue walletcreatefundedpsbt()

4086 FundTransaction(pwallet, rawTx, fee, change_position, request.params[3]);

static UniValue fundrawtransaction()

3137 FundTransaction(pwallet, tx, fee, change_position, request.params[1]);

Documentation of changed RPCs

bumpfee

  • fee_rate option: "feerate (NOT total fee) to pay, in BTC per kB"

fundrawtransaction

  • feeRate option: "Set a specific fee rate in BTC/kB"
  • fee rate set in conf_target (for BTC/kB or sat/B modes)

sendmany

  • fee rate set in conf_target: "fee rate (for BTC/kB or sat/B estimate modes)"

sendtoaddress

  • fee rate set in conf_target: "fee rate (for BTC/kB or sat/B estimate modes)"

walletcreatefundedpsbt

  • feeRate option: "Set a specific fee rate in BTC/kB"

Manual testing

bitcoin/bitcoin#11413 by @Sjors

"Positional args are nigh-impossible to use, but let's worry about that later.."

bitcoin-cli sendtoaddress bc... 1 "" "" false true 1 sat/b
bitcoin-cli sendmany "" '{"bc...": 1}' 0 "" '[]' true 1 sat/b

"A mix of positional and named args sort of works:"

sendtoaddress bcrt1qgr3zfmvqzl4uv3utz6h849x0fu5a8mvg695jde 1 -conf_target=1 estimate_mode=sat/b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment