79d6332e9e moveonly: Fix indentation in bumpfee RPC (Andrew Chow)
431071c28a Hide bumpfee's psbt creation behavior behind -deprecatedrpc (Andrew Chow)
4638224f64 Add psbtbumpfee RPC (Andrew Chow)
Pull request description:
Adds a new RPC `psbtbumpfee` which always creates a psbt. `bumpfee` will then only be able to create and broadcast fee bumping transactions instead of changing its behavior based on `IsWalletSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)`.
Split from #18627
ACKs for top commit:
Sjors:
re-utACK 79d6332
meshcollider:
utACK 79d6332e9e
fjahr:
Code review ACK 79d6332e9e
Tree-SHA512: 1c92c4b4461bb30e78be3ee73165f624398ef33996ce36043b61a8931be667030d0fca12fd0b30097b78c56e4e9092c69582b237cbdac51d56f6be23d8c0f1bb
"\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n"
"An opt-in RBF transaction with the given txid must be in the wallet.\n"
"The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist.\n"
"All inputs in the original transaction will be included in the replacement transaction.\n"
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
"The user can specify a confirmation target for estimatesmartfee.\n"
"Alternatively, the user can specify a fee_rate ("+CURRENCY_UNIT+" per kB) for the new transaction.\n"
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
"returned by getnetworkinfo) to enter the node's mempool.\n",
boolwant_psbt=request.strMethod=="psbtbumpfee";
RPCHelpMan{request.strMethod,
"\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n"
+std::string(want_psbt?"Returns a PSBT instead of creating and signing a new transaction.\n":"")+
"An opt-in RBF transaction with the given txid must be in the wallet.\n"
"The command will pay the additional fee by reducing change outputs or adding inputs when necessary. It may add a new change output if one does not already exist.\n"
"All inputs in the original transaction will be included in the replacement transaction.\n"
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
"The user can specify a confirmation target for estimatesmartfee.\n"
"Alternatively, the user can specify a fee_rate ("+CURRENCY_UNIT+" per kB) for the new transaction.\n"
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
"returned by getnetworkinfo) to enter the node's mempool.\n",
{
{"txid",RPCArg::Type::STR_HEX,RPCArg::Optional::NO,"The txid to be bumped"},
{RPCResult::Type::STR,"psbt","The base64-encoded unsigned PSBT of the new transaction."+std::string(want_psbt?"":" Only returned when wallet private keys are disabled. (DEPRECATED)")},
},
want_psbt?std::vector<RPCResult>{}:std::vector<RPCResult>{{RPCResult::Type::STR_HEX,"txid","The id of the new transaction. Only returned when wallet private keys are enabled."}}
),
{
{RPCResult::Type::STR_AMOUNT,"origfee","The fee of the replaced transaction."},
{RPCResult::Type::STR_AMOUNT,"fee","The fee of the new transaction."},
{RPCResult::Type::ARR,"errors","Errors encountered during processing (may be empty).",
{
{RPCResult::Type::STR,"",""},
}},
})
},
RPCExamples{
"\nBump the fee, get the new transaction\'s"+std::string(want_psbt?"psbt":"txid")+"\n"+
throwJSONRPCError(RPC_METHOD_DEPRECATED,"Using bumpfee with wallets that have private keys disabled is deprecated. Use psbtbumpfee instead or restart bitcoind with -deprecatedrpc=bumpfee. This functionality will be removed in 0.22");
assert_raises_rpc_error(-32,'Using bumpfee with wallets that have private keys disabled is deprecated. Use psbtbumpfee instead or restart bitcoind with -deprecatedrpc=bumpfee. This functionality will be removed in 0.22',noprivs0.bumpfee,txid)