From a8d218865186983590b92f87fbec209faf59bd4c Mon Sep 17 00:00:00 2001 From: miketout Date: Thu, 11 Oct 2018 22:47:07 -0700 Subject: [PATCH] Timeout adjustment --- src/rpc/mining.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 34b4d6a9d..9ec6ca6f4 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -612,7 +612,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) if (Params().MiningRequiresPeers() && (IsNotInSync() || fvNodesEmpty)) { int loops = 0, blockDiff = 0, newDiff = 0; - + const int delay = 15; do { if (fvNodesEmpty) { @@ -630,7 +630,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) } else { - if (++loops <= 10) + if (++loops <= delay) { MilliSleep(1000); } @@ -638,7 +638,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) } } } while (fvNodesEmpty || IsNotInSync()); - if (loops > 10) + if (loops > delay) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Cannot get a block template while no peers are connected or chain not in sync!"); }