From 5cb7ac23fb97a0cbc75b7eef0951da0e0bc5292b Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Fri, 21 May 2021 21:57:49 +0200 Subject: rpc: fix docs for bumpfee psbt update - "psbt" field is only returned in psbtbumpfee and not bumpfee - bumpfee raises if privkeys are disabled, so drop "Only returned when wallet private keys are enabled." - add missing space in RPC example --- src/wallet/rpcwallet.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4e3c8ce49d..8aac9f8f25 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3430,12 +3430,10 @@ static RPCHelpMan bumpfee_helper(std::string method_name) "options"}, }, RPCResult{ - RPCResult::Type::OBJ, "", "", Cat(Cat>( - { - {RPCResult::Type::STR, "psbt", "The base64-encoded unsigned PSBT of the new transaction."}, - }, - want_psbt ? std::vector{} : std::vector{{RPCResult::Type::STR_HEX, "txid", "The id of the new transaction. Only returned when wallet private keys are enabled."}} - ), + RPCResult::Type::OBJ, "", "", Cat( + want_psbt ? + std::vector{{RPCResult::Type::STR, "psbt", "The base64-encoded unsigned PSBT of the new transaction."}} : + std::vector{{RPCResult::Type::STR_HEX, "txid", "The id of the new transaction."}}, { {RPCResult::Type::STR_AMOUNT, "origfee", "The fee of the replaced transaction."}, {RPCResult::Type::STR_AMOUNT, "fee", "The fee of the new transaction."}, @@ -3446,7 +3444,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name) }) }, RPCExamples{ - "\nBump the fee, get the new transaction\'s" + std::string(want_psbt ? "psbt" : "txid") + "\n" + + "\nBump the fee, get the new transaction\'s " + std::string(want_psbt ? "psbt" : "txid") + "\n" + HelpExampleCli(method_name, "") }, [want_psbt](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue -- cgit v1.2.3 From 4f504f826bcbb1a4aa4701e87cb68da4ca05b857 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sat, 22 May 2021 09:30:26 +0200 Subject: rpc: fix code comment for bumpfee/psbtbumpfee output --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 8aac9f8f25..a2124cc05e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3526,8 +3526,8 @@ static RPCHelpMan bumpfee_helper(std::string method_name) UniValue result(UniValue::VOBJ); - // If wallet private keys are enabled, return the new transaction id, - // otherwise return the base64-encoded unsigned PSBT of the new transaction. + // For bumpfee, return the new transaction id. + // For psbtbumpfee, return the base64-encoded unsigned PSBT of the new transaction. if (!want_psbt) { if (!feebumper::SignTransaction(*pwallet, mtx)) { throw JSONRPCError(RPC_WALLET_ERROR, "Can't sign transaction."); -- cgit v1.2.3