Skip to content

Commit

Permalink
update getblocktemplate conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheComputerGenie committed Nov 30, 2020
1 parent a4f6840 commit fe86527
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp, const CPubKey& myp
LOCK(cs_vNodes);
fvNodesEmpty = vNodes.empty();
}
if (Params().MiningRequiresPeers() && (IsNotInSync() || fvNodesEmpty))
if (Params().MiningRequiresPeers() && fvNodesEmpty)
{
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, "Pirate is not connected!");
}

//if (IsInitialBlockDownload())
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Zcash is downloading blocks...");
// currently we have checkpoints only in KMD chain, so we checking IsInitialBlockDownload only for KMD itself
if (ASSETCHAINS_SYMBOL[0] == 0 && IsInitialBlockDownload()) {
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Pirate is downloading blocks...");
}

static unsigned int nTransactionsUpdatedLast;

Expand Down

0 comments on commit fe86527

Please sign in to comment.