diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index a6d708e53..ba09c09e7 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -169,6 +169,10 @@ void AsyncRPCOperation_sendmany::main() { set_error_message("unknown error"); } + unlock_notes(); + unlock_utxos(); + LogPrintf("%s: z_sendmany input notes+utxos unlocked\n", __func__, getId()); + #ifdef ENABLE_MINING #ifdef ENABLE_WALLET GenerateBitcoins(GetBoolArg("-gen",false), pwalletMain, GetArg("-genproclimit", 1)); @@ -179,6 +183,7 @@ void AsyncRPCOperation_sendmany::main() { stop_execution_clock(); + if (success) { set_state(OperationStatus::SUCCESS); } else { @@ -193,9 +198,6 @@ void AsyncRPCOperation_sendmany::main() { } LogPrintf("%s",s); - unlock_notes(); // clean up - unlock_utxos(); // clean up - LogPrint("zrpc", "%s: z_sendmany input notes+utxos unlocked\n", getId()); } // Notes: