From 49c2cecb9f75faad50f9bdbf3e249bedd2c17e3f Mon Sep 17 00:00:00 2001 From: Allan Niemerg Date: Sun, 4 Dec 2016 21:05:30 -0600 Subject: [PATCH] Pause mining during joinsplit creation --- src/wallet/asyncrpcoperation_sendmany.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index 9e27b971a..941daf844 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 @@ -101,6 +102,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 (Object objError) { @@ -119,6 +128,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) {