Skip to content

Commit

Permalink
Auto merge of #1932 - aniemerg:1522-pause-mining-for-joinsplit, r=arc…
Browse files Browse the repository at this point in the history
…alinea

Pause mining during JoinSplit creation

Closes #1522 .
  • Loading branch information
zkbot committed Mar 2, 2017
2 parents 44ccf1f + 49c2cec commit 312fbd9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/wallet/asyncrpcoperation_sendmany.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "rpcprotocol.h"
#include "zcash/IncrementalMerkleTree.hpp"
#include "sodium.h"
#include "miner.h"

#include <iostream>
#include <chrono>
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 312fbd9

Please sign in to comment.