diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index de9744bb8..1691452b8 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -21,6 +21,7 @@ #include "rpcprotocol.h" #include "zcash/IncrementalMerkleTree.hpp" #include "sodium.h" +#include "miner.h" #include #include @@ -112,6 +113,14 @@ void AsyncRPCOperation_sendmany::main() { bool success = false; +#ifdef ENABLE_MINING + #ifdef ENABLE_WALLET + GenerateBitcoins(false, NULL, 0); + #else + GenerateBitcoins(false, 0); + #endif +#endif + try { success = main_impl(); } catch (const UniValue& objError) { @@ -133,6 +142,14 @@ void AsyncRPCOperation_sendmany::main() { set_error_message("unknown error"); } +#ifdef ENABLE_MINING + #ifdef ENABLE_WALLET + GenerateBitcoins(GetBoolArg("-gen",false), pwalletMain, GetArg("-genproclimit", 1)); + #else + GenerateBitcoins(GetBoolArg("-gen",false), GetArg("-genproclimit", 1)); + #endif +#endif + stop_execution_clock(); if (success) {