From 492fbcd0230092375ed4ace4774e3bf7468da6d7 Mon Sep 17 00:00:00 2001 From: Duke Date: Tue, 20 May 2025 12:21:47 -0400 Subject: [PATCH] Leave opretValue null unless a 5th argument is given to avoid adding empty opreturns --- src/wallet/rpcwallet.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3b5d06fb4..0193f9fd2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5153,7 +5153,10 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk) CAmount nTotalOut = 0; // Optional OP_RETURN data 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;