Optional OP_RETURN in z_sendmany

This commit is contained in:
Duke
2023-03-24 10:22:31 -07:00
parent 63ad87f69b
commit 8126e706c6
3 changed files with 23 additions and 5 deletions

View File

@@ -65,8 +65,9 @@ AsyncRPCOperation_sendmany::AsyncRPCOperation_sendmany(
std::vector<SendManyRecipient> zOutputs,
int minDepth,
CAmount fee,
UniValue contextInfo) :
tx_(contextualTx), fromaddress_(fromAddress), t_outputs_(tOutputs), z_outputs_(zOutputs), mindepth_(minDepth), fee_(fee), contextinfo_(contextInfo)
UniValue contextInfo,
CScript opret) :
tx_(contextualTx), fromaddress_(fromAddress), t_outputs_(tOutputs), z_outputs_(zOutputs), mindepth_(minDepth), fee_(fee), contextinfo_(contextInfo), opret_(opret)
{
assert(fee_ >= 0);
@@ -469,6 +470,10 @@ bool AsyncRPCOperation_sendmany::main_impl() {
}
}
// Add optional OP_RETURN if it exists
if ( opret_ != CScript() ) {
builder_.AddOpRet(opret_);
}
// Build the transaction
auto maybe_tx = builder_.Build();
if (!maybe_tx) {