Timeout adjustment

This commit is contained in:
miketout
2018-10-11 22:47:07 -07:00
parent 69fa3d0e00
commit a8d2188651

View File

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