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!"); }