There is now only one opreturn possible in z_sendmany so pull the assignment to opret out of the loop

This commit is contained in:
Duke
2025-05-29 15:31:47 -04:00
parent 38901a073b
commit cc1c0b30b0

View File

@@ -5172,6 +5172,11 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
bool containsSaplingOutput = false;
// Create the CScript representation of the OP_RETURN
if (!opretValue.isNull()) {
opret << OP_RETURN << ParseHex(opretValue.get_str().c_str());
}
for (const UniValue& o : outputs.getValues()) {
if (!o.isObject())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected object");
@@ -5198,11 +5203,6 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
// throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Extreme Privacy! You must send to a zaddr");
//}
// Create the CScript representation of the OP_RETURN
if (!opretValue.isNull()) {
opret << OP_RETURN << ParseHex(opretValue.get_str().c_str());
}
UniValue memoValue = find_value(o, "memo");
string memo;
if (!memoValue.isNull()) {