diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index c9b36df48..03c0f167c 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -169,33 +169,37 @@ void CMasternodeSync::SwitchToNextAsset() LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); break; case(MASTERNODE_SYNC_SPORKS): + LogPrintf("CMasternodeSync::SwitchToNextAsset -- Completed %s in %ss\n", GetAssetName(), GetTime() - nTimeAssetSyncStarted); nTimeLastMasternodeList = GetTime(); nRequestedMasternodeAssets = MASTERNODE_SYNC_LIST; LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); break; case(MASTERNODE_SYNC_LIST): + LogPrintf("CMasternodeSync::SwitchToNextAsset -- Completed %s in %ss\n", GetAssetName(), GetTime() - nTimeAssetSyncStarted); nTimeLastPaymentVote = GetTime(); nRequestedMasternodeAssets = MASTERNODE_SYNC_MNW; LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); break; case(MASTERNODE_SYNC_MNW): + LogPrintf("CMasternodeSync::SwitchToNextAsset -- Completed %s in %ss\n", GetAssetName(), GetTime() - nTimeAssetSyncStarted); nTimeLastGovernanceItem = GetTime(); nRequestedMasternodeAssets = MASTERNODE_SYNC_GOVERNANCE; LogPrintf("CMasternodeSync::SwitchToNextAsset -- Starting %s\n", GetAssetName()); break; case(MASTERNODE_SYNC_GOVERNANCE): - LogPrintf("CMasternodeSync::SwitchToNextAsset -- Sync has finished\n"); + LogPrintf("CMasternodeSync::SwitchToNextAsset -- Completed %s in %ss\n", GetAssetName(), GetTime() - nTimeAssetSyncStarted); nRequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED; uiInterface.NotifyAdditionalDataSyncProgressChanged(1); //try to activate our masternode if possible activeMasternode.ManageState(); TRY_LOCK(cs_vNodes, lockRecv); - if(!lockRecv) return; - - BOOST_FOREACH(CNode* pnode, vNodes) { - netfulfilledman.AddFulfilledRequest(pnode->addr, "full-sync"); + if(lockRecv) { + BOOST_FOREACH(CNode* pnode, vNodes) { + netfulfilledman.AddFulfilledRequest(pnode->addr, "full-sync"); + } } + LogPrintf("CMasternodeSync::SwitchToNextAsset -- Sync has finished\n"); break; } diff --git a/src/masternode-sync.h b/src/masternode-sync.h index 7f4666dac..c9b044f04 100644 --- a/src/masternode-sync.h +++ b/src/masternode-sync.h @@ -77,6 +77,7 @@ public: int GetAssetID() { return nRequestedMasternodeAssets; } int GetAttempt() { return nRequestedMasternodeAttempt; } + int64_t GetAssetStartTime() { return nTimeAssetSyncStarted; } std::string GetAssetName(); std::string GetSyncStatus(); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index bcf522b9a..8913ba47e 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -153,6 +153,7 @@ UniValue mnsync(const UniValue& params, bool fHelp) UniValue objStatus(UniValue::VOBJ); objStatus.push_back(Pair("AssetID", masternodeSync.GetAssetID())); objStatus.push_back(Pair("AssetName", masternodeSync.GetAssetName())); + objStatus.push_back(Pair("AssetStartTime", masternodeSync.GetAssetStartTime())); objStatus.push_back(Pair("Attempt", masternodeSync.GetAttempt())); objStatus.push_back(Pair("IsBlockchainSynced", masternodeSync.IsBlockchainSynced())); objStatus.push_back(Pair("IsMasternodeListSynced", masternodeSync.IsMasternodeListSynced()));