stop mining before completely synced, more info in rpc
This commit is contained in:
parent
e52809a031
commit
ac488d70b9
@ -20,6 +20,7 @@
|
|||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
#endif
|
#endif
|
||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
|
#include "masternode-sync.h"
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
@ -474,7 +475,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
fvNodesEmpty = vNodes.empty();
|
fvNodesEmpty = vNodes.empty();
|
||||||
}
|
}
|
||||||
if (!fvNodesEmpty && !IsInitialBlockDownload())
|
if (!fvNodesEmpty && masternodeSync.IsSynced())
|
||||||
break;
|
break;
|
||||||
MilliSleep(1000);
|
MilliSleep(1000);
|
||||||
} while (true);
|
} while (true);
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
|
#include "masternode-sync.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -442,8 +443,11 @@ Value getblocktemplate(const Array& params, bool fHelp)
|
|||||||
if (vNodes.empty())
|
if (vNodes.empty())
|
||||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Dash is not connected!");
|
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Dash is not connected!");
|
||||||
|
|
||||||
if (IsInitialBlockDownload())
|
if (!masternodeSync.IsBlockchainSynced())
|
||||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Dash is downloading blocks...");
|
throw JSONRPCError(RPC_CLIENT_IN_BLOCKCHAIN_SYNC, "Dash is trying to sync blocks...");
|
||||||
|
|
||||||
|
if (!masternodeSync.IsSynced())
|
||||||
|
throw JSONRPCError(RPC_CLIENT_IN_ADDITIONAL_SYNC, "Dash is trying to sync additional data... Use 'mnsync status' to get more info.");
|
||||||
|
|
||||||
static unsigned int nTransactionsUpdatedLast;
|
static unsigned int nTransactionsUpdatedLast;
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ Value mnsync(const Array& params, bool fHelp)
|
|||||||
Object obj;
|
Object obj;
|
||||||
|
|
||||||
obj.push_back(Pair("IsBlockchainSynced", masternodeSync.IsBlockchainSynced()));
|
obj.push_back(Pair("IsBlockchainSynced", masternodeSync.IsBlockchainSynced()));
|
||||||
|
obj.push_back(Pair("IsSynced", masternodeSync.IsSynced()));
|
||||||
obj.push_back(Pair("lastMasternodeList", masternodeSync.lastMasternodeList));
|
obj.push_back(Pair("lastMasternodeList", masternodeSync.lastMasternodeList));
|
||||||
obj.push_back(Pair("lastMasternodeWinner", masternodeSync.lastMasternodeWinner));
|
obj.push_back(Pair("lastMasternodeWinner", masternodeSync.lastMasternodeWinner));
|
||||||
obj.push_back(Pair("lastBudgetItem", masternodeSync.lastBudgetItem));
|
obj.push_back(Pair("lastBudgetItem", masternodeSync.lastBudgetItem));
|
||||||
|
@ -63,6 +63,8 @@ enum RPCErrorCode
|
|||||||
//! P2P client errors
|
//! P2P client errors
|
||||||
RPC_CLIENT_NOT_CONNECTED = -9, //! Dash is not connected
|
RPC_CLIENT_NOT_CONNECTED = -9, //! Dash is not connected
|
||||||
RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, //! Still downloading initial blocks
|
RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, //! Still downloading initial blocks
|
||||||
|
RPC_CLIENT_IN_BLOCKCHAIN_SYNC = -110,//! Syncing blocks
|
||||||
|
RPC_CLIENT_IN_ADDITIONAL_SYNC = -111,//! Syncing additional data
|
||||||
RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added
|
RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added
|
||||||
RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before
|
RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user