Skip to content

Commit f110b7c

Browse files
committed
rpc: document returned error fields as optional if applicable
Affects the following RPCs: - analyzepsbt - estimatesmartfee - signrawtransactionwithkey - signrawtransactionwithwallet For the RPC estimaterawfee, the description message was adapted to match the other optional ones.
1 parent a787428 commit f110b7c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/rpc/mining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static UniValue estimatesmartfee(const JSONRPCRequest& request)
10191019
RPCResult::Type::OBJ, "", "",
10201020
{
10211021
{RPCResult::Type::NUM, "feerate", /* optional */ true, "estimate fee rate in " + CURRENCY_UNIT + "/kB (only present if no errors were encountered)"},
1022-
{RPCResult::Type::ARR, "errors", "Errors encountered during processing",
1022+
{RPCResult::Type::ARR, "errors", /* optional */ true, "Errors encountered during processing (if there are any)",
10231023
{
10241024
{RPCResult::Type::STR, "", "error"},
10251025
}},
@@ -1098,7 +1098,7 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
10981098
{
10991099
{RPCResult::Type::ELISION, "", ""},
11001100
}},
1101-
{RPCResult::Type::ARR, "errors", /* optional */ true, "Errors encountered during processing",
1101+
{RPCResult::Type::ARR, "errors", /* optional */ true, "Errors encountered during processing (if there are any)",
11021102
{
11031103
{RPCResult::Type::STR, "error", ""},
11041104
}},

src/rpc/rawtransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
744744
{
745745
{RPCResult::Type::STR_HEX, "hex", "The hex-encoded raw transaction with signature(s)"},
746746
{RPCResult::Type::BOOL, "complete", "If the transaction has a complete set of signatures"},
747-
{RPCResult::Type::ARR, "errors", "Script verification errors (if there are any)",
747+
{RPCResult::Type::ARR, "errors", /* optional */ true, "Script verification errors (if there are any)",
748748
{
749749
{RPCResult::Type::OBJ, "", "",
750750
{
@@ -1722,7 +1722,7 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
17221722
{RPCResult::Type::STR_AMOUNT, "estimated_feerate", /* optional */ true, "Estimated feerate of the final signed transaction in " + CURRENCY_UNIT + "/kB. Shown only if all UTXO slots in the PSBT have been filled"},
17231723
{RPCResult::Type::STR_AMOUNT, "fee", /* optional */ true, "The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled"},
17241724
{RPCResult::Type::STR, "next", "Role of the next person that this psbt needs to go to"},
1725-
{RPCResult::Type::STR, "error", "Error message if there is one"},
1725+
{RPCResult::Type::STR, "error", /* optional */ true, "Error message (if there is one)"},
17261726
}
17271727
},
17281728
RPCExamples {

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3165,7 +3165,7 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request)
31653165
{
31663166
{RPCResult::Type::STR_HEX, "hex", "The hex-encoded raw transaction with signature(s)"},
31673167
{RPCResult::Type::BOOL, "complete", "If the transaction has a complete set of signatures"},
3168-
{RPCResult::Type::ARR, "errors", "Script verification errors (if there are any)",
3168+
{RPCResult::Type::ARR, "errors", /* optional */ true, "Script verification errors (if there are any)",
31693169
{
31703170
{RPCResult::Type::OBJ, "", "",
31713171
{

0 commit comments

Comments
 (0)