diff --git a/src/miner.cpp b/src/miner.cpp index 4a6f89f9b..66ecbf60b 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -25,6 +25,7 @@ #include "util.h" #include "utilmoneystr.h" #include "masternode-payments.h" +#include "masternode-sync.h" #include "validationinterface.h" #include @@ -422,7 +423,7 @@ void static BitcoinMiner(const CChainParams& chainparams) LOCK(cs_vNodes); fvNodesEmpty = vNodes.empty(); } - if (!fvNodesEmpty && !IsInitialBlockDownload()) + if (!fvNodesEmpty && !IsInitialBlockDownload() && masternodeSync.IsSynced()) break; MilliSleep(1000); } while (true); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 9ac912a9c..d376364db 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -463,6 +463,9 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) if (IsInitialBlockDownload()) throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash Core is downloading blocks..."); + if (!masternodeSync.IsSynced()) + throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash Core is syncing with network..."); + static unsigned int nTransactionsUpdatedLast; if (!lpval.isNull())