Skip to content

Commit fe86527

Browse files
update getblocktemplate conditions
1 parent a4f6840 commit fe86527

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/rpc/mining.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -705,13 +705,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp, const CPubKey& myp
705705
LOCK(cs_vNodes);
706706
fvNodesEmpty = vNodes.empty();
707707
}
708-
if (Params().MiningRequiresPeers() && (IsNotInSync() || fvNodesEmpty))
708+
if (Params().MiningRequiresPeers() && fvNodesEmpty)
709709
{
710-
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Cannot get a block template while no peers are connected or chain not in sync!");
710+
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Pirate is not connected!");
711711
}
712712

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

716718
static unsigned int nTransactionsUpdatedLast;
717719

0 commit comments

Comments
 (0)