Leave opretValue null unless a 5th argument is given to avoid adding empty opreturns

This commit is contained in:
Duke
2025-05-20 12:21:47 -04:00
parent 97878fa065
commit 492fbcd023

View File

@@ -5153,7 +5153,10 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
CAmount nTotalOut = 0; CAmount nTotalOut = 0;
// Optional OP_RETURN data // Optional OP_RETURN data
CScript opret; CScript opret;
UniValue opretValue = params.size() >= 4 ? params[4].get_str() : ""; UniValue opretValue;
if(params.size() == 5) {
opretValue = params[4].get_str();
}
bool containsSaplingOutput = false; bool containsSaplingOutput = false;