Skip to content

Commit fd8c56d

Browse files
achow101vijaydasmp
authored andcommitted
Merge 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 bitcoin#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
1 parent bf1eb46 commit fd8c56d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/rpc/rawtransaction.cpp

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

src/wallet/rpc/spend.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,9 @@ RPCHelpMan send()
803803
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n"
804804
"\nSend a transaction.\n",
805805
{
806-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
807-
"That is, each address can only appear once and there can only be one 'data' object.\n"
806+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n"
807+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
808+
"At least one output of either type must be specified.\n"
808809
"For convenience, a dictionary, which holds the key-value pairs directly, is also accepted.",
809810
{
810811
{"", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, "",
@@ -1097,8 +1098,9 @@ RPCHelpMan walletcreatefundedpsbt()
10971098
},
10981099
},
10991100
},
1100-
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
1101-
"That is, each address can only appear once and there can only be one 'data' object.\n"
1101+
{"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs specified as key-value pairs.\n"
1102+
"Each key may only appear once, i.e. there can only be one 'data' output, and no address may be duplicated.\n"
1103+
"At least one output of either type must be specified.\n"
11021104
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
11031105
"accepted as second parameter.",
11041106
{

0 commit comments

Comments
 (0)