Skip to content

Commit 23f3f40

Browse files
committed
Merge bitcoin/bitcoin#27829: rpc: fix data optionality for RPC calls.
27b168b Update help text for spend and rawtransaction rpcs (Michael Tidwell) Pull request description: The "data" field without outputs was marked as "required" in the help docs when using bitcoin-cli. This field when left off worked as an intended optional OP_RETURN. closes #27828. Motivation: It is hard to understand that "data" is actually optional for commands like `createpsbt` and `walletcreatefundedpsbt`. ACKs for top commit: achow101: ACK 27b168b Sjors: tACK 27b168b Tree-SHA512: 235e7ed4af69880880c04015b3f7de72c8f31ae035485c4c64c483e282948f3ea3f1eef16f15e260a1aaf21114150713516ba6a99967ccad9ecd91ff67cb0450
2 parents 8ff90d9 + 27b168b commit 23f3f40

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ static std::vector<RPCArg> CreateTxDoc()
147147
},
148148
},
149149
},
150-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
151-
"That is, each address can only appear once and there can only be one 'data' object.\n"
150+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n"
151+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
152+
"At least one output of either type must be specified.\n"
152153
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
153154
" accepted as second parameter.",
154155
{

src/wallet/rpc/spend.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,9 +1014,9 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
10141014
"are replaceable).\n"},
10151015
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, "The fee estimate mode, must be one of (case insensitive):\n"
10161016
"\"" + FeeModes("\"\n\"") + "\""},
1017-
{"outputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "New outputs (key-value pairs) which will replace\n"
1018-
"the original ones, if provided. Each address can only appear once and there can\n"
1019-
"only be one \"data\" object.\n"
1017+
{"outputs", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The outputs specified as key-value pairs.\n"
1018+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
1019+
"At least one output of either type must be specified.\n"
10201020
"Cannot be provided if 'reduce_output' is specified.",
10211021
OutputsDoc(),
10221022
RPCArgOptions{.skip_type_check = true}},
@@ -1188,8 +1188,9 @@ RPCHelpMan send()
11881188
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n"
11891189
"\nSend a transaction.\n",
11901190
{
1191-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
1192-
"That is, each address can only appear once and there can only be one 'data' object.\n"
1191+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n"
1192+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
1193+
"At least one output of either type must be specified.\n"
11931194
"For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.",
11941195
OutputsDoc(),
11951196
RPCArgOptions{.skip_type_check = true}},
@@ -1638,8 +1639,9 @@ RPCHelpMan walletcreatefundedpsbt()
16381639
},
16391640
},
16401641
},
1641-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
1642-
"That is, each address can only appear once and there can only be one 'data' object.\n"
1642+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n"
1643+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
1644+
"At least one output of either type must be specified.\n"
16431645
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
16441646
"accepted as second parameter.",
16451647
OutputsDoc(),

0 commit comments

Comments
 (0)