You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #14890: rpc: Avoid creating non-standard raw transactions
fa4c867 rpc: Avoid creating non-standard raw transactions (MarcoFalke)
Pull request description:
Multiple OP_RETURN outputs in a transaction are not standard and unlikely to be relayed, so avoid creating them.
Apart from that, the logic was broken in that it duplicated the same hex-data for each data output: Closes #14868.
Tree-SHA512: b08d08062b5622e8a7b497e490ccaf53b06e844c863fda3bf3f932a98684a809e8341aeb98232059a795afb32d8770a6c5591a66f8e6ee372b672af245607887
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs).\n"
477
+
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs), where none of the keys are duplicated.\n"
478
+
"That is, each address can only appear once and there can only be one 'data' object.\n"
470
479
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs).\n"
1620
+
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs), where none of the keys are duplicated.\n"
1621
+
"That is, each address can only appear once and there can only be one 'data' object.\n"
1612
1622
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs).\n"
4026
+
{"outputs", RPCArg::Type::ARR, /* opt */false, /* default_val */"", "a json array with outputs (key-value pairs), where none of the keys are duplicated.\n"
4027
+
"That is, each address can only appear once and there can only be one 'data' object.\n"
4027
4028
"For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair must contain exactly one key", self.nodes[0].createrawtransaction, [], [{'a': 1, 'b': 2}])
104
106
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair not an object as expected", self.nodes[0].createrawtransaction, [], [['key-value pair1'], ['2']])
0 commit comments