Skip to content

Commit db1aca0

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22021: rpc: bumpfee/psbtbumpfee fixes and updates
4f504f8 rpc: fix code comment for bumpfee/psbtbumpfee output (Jon Atack) 5cb7ac2 rpc: fix docs for bumpfee psbt update (Jon Atack) Pull request description: Follow-up to #21544 and #20891 for the `bumpfee_helper` used for RPCs bumpfee and psbtbumpfee: - "psbt" field is only returned in psbtbumpfee and not bumpfee - bumpfee raises if private keys are disabled, so the txid help "Only returned when wallet private keys are enabled." no longer makes sense; remove it - add missing space in RPC examples ("Bump the fee, get the new transaction'stxid") - update txid/psbt code comments ACKs for top commit: klementtan: ACK [`4f504f8`](bitcoin/bitcoin@4f504f8) Tree-SHA512: 194faf8af52383eb8ac5cd22825265931bcde135dac79d8ecc4f84f698070da9b9373c00eef8623961881bb293157c7c9a0d71d1bcccf481ae3605a2d1444ed8
2 parents aeecb1c + 4f504f8 commit db1aca0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,12 +3430,10 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
34303430
"options"},
34313431
},
34323432
RPCResult{
3433-
RPCResult::Type::OBJ, "", "", Cat(Cat<std::vector<RPCResult>>(
3434-
{
3435-
{RPCResult::Type::STR, "psbt", "The base64-encoded unsigned PSBT of the new transaction."},
3436-
},
3437-
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."}}
3438-
),
3433+
RPCResult::Type::OBJ, "", "", Cat(
3434+
want_psbt ?
3435+
std::vector<RPCResult>{{RPCResult::Type::STR, "psbt", "The base64-encoded unsigned PSBT of the new transaction."}} :
3436+
std::vector<RPCResult>{{RPCResult::Type::STR_HEX, "txid", "The id of the new transaction."}},
34393437
{
34403438
{RPCResult::Type::STR_AMOUNT, "origfee", "The fee of the replaced transaction."},
34413439
{RPCResult::Type::STR_AMOUNT, "fee", "The fee of the new transaction."},
@@ -3446,7 +3444,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
34463444
})
34473445
},
34483446
RPCExamples{
3449-
"\nBump the fee, get the new transaction\'s" + std::string(want_psbt ? "psbt" : "txid") + "\n" +
3447+
"\nBump the fee, get the new transaction\'s " + std::string(want_psbt ? "psbt" : "txid") + "\n" +
34503448
HelpExampleCli(method_name, "<txid>")
34513449
},
34523450
[want_psbt](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
@@ -3528,8 +3526,8 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
35283526

35293527
UniValue result(UniValue::VOBJ);
35303528

3531-
// If wallet private keys are enabled, return the new transaction id,
3532-
// otherwise return the base64-encoded unsigned PSBT of the new transaction.
3529+
// For bumpfee, return the new transaction id.
3530+
// For psbtbumpfee, return the base64-encoded unsigned PSBT of the new transaction.
35333531
if (!want_psbt) {
35343532
if (!feebumper::SignTransaction(*pwallet, mtx)) {
35353533
throw JSONRPCError(RPC_WALLET_ERROR, "Can't sign transaction.");

0 commit comments

Comments
 (0)