Timeout adjustment
This commit is contained in:
@@ -612,7 +612,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
if (Params().MiningRequiresPeers() && (IsNotInSync() || fvNodesEmpty))
|
if (Params().MiningRequiresPeers() && (IsNotInSync() || fvNodesEmpty))
|
||||||
{
|
{
|
||||||
int loops = 0, blockDiff = 0, newDiff = 0;
|
int loops = 0, blockDiff = 0, newDiff = 0;
|
||||||
|
const int delay = 15;
|
||||||
do {
|
do {
|
||||||
if (fvNodesEmpty)
|
if (fvNodesEmpty)
|
||||||
{
|
{
|
||||||
@@ -630,7 +630,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (++loops <= 10)
|
if (++loops <= delay)
|
||||||
{
|
{
|
||||||
MilliSleep(1000);
|
MilliSleep(1000);
|
||||||
}
|
}
|
||||||
@@ -638,7 +638,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (fvNodesEmpty || IsNotInSync());
|
} 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!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Cannot get a block template while no peers are connected or chain not in sync!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user