z_sendmany: Only get ua if decoded is ua variant.
This commit is contained in:
parent
94ab8e4c77
commit
79c0514919
|
@ -4557,7 +4557,11 @@ UniValue z_sendmany(const UniValue& params, bool fHelp)
|
|||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, amount must be positive");
|
||||
}
|
||||
|
||||
std::optional<libzcash::UnifiedAddress> ua = std::get<libzcash::UnifiedAddress>(decoded.value());
|
||||
std::optional<libzcash::UnifiedAddress> ua = std::nullopt;
|
||||
if (std::holds_alternative<libzcash::UnifiedAddress>(decoded.value())) {
|
||||
ua = std::get<libzcash::UnifiedAddress>(decoded.value());
|
||||
}
|
||||
|
||||
recipients.push_back(SendManyRecipient(ua, addr.value(), nAmount, memo));
|
||||
nTotalOut += nAmount;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue