Bail out in few more places when blockchain is not synced yet (#2888)
* Bail out in few more places when blockchain is not synced yet * Apply review suggestion
This commit is contained in:
parent
fd6aaae7f0
commit
fbd244dded
@ -15,6 +15,7 @@
|
||||
#include "activemasternode.h"
|
||||
#include "chainparams.h"
|
||||
#include "init.h"
|
||||
#include "masternode-sync.h"
|
||||
#include "univalue.h"
|
||||
#include "validation.h"
|
||||
|
||||
@ -161,7 +162,7 @@ CQuorumManager::CQuorumManager(CEvoDB& _evoDb, CBLSWorker& _blsWorker, CDKGSessi
|
||||
|
||||
void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitialDownload)
|
||||
{
|
||||
if (fInitialDownload) {
|
||||
if (!masternodeSync.IsBlockchainSynced()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "quorums_utils.h"
|
||||
|
||||
#include "chain.h"
|
||||
#include "masternode-sync.h"
|
||||
#include "net_processing.h"
|
||||
#include "scheduler.h"
|
||||
#include "spork.h"
|
||||
@ -232,15 +233,20 @@ void CChainLocksHandler::TrySignChainTip()
|
||||
{
|
||||
Cleanup();
|
||||
|
||||
if (!fMasternodeMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!masternodeSync.IsBlockchainSynced()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const CBlockIndex* pindex;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
pindex = chainActive.Tip();
|
||||
}
|
||||
|
||||
if (!fMasternodeMode) {
|
||||
return;
|
||||
}
|
||||
if (!pindex->pprev) {
|
||||
return;
|
||||
}
|
||||
@ -594,6 +600,10 @@ bool CChainLocksHandler::InternalHasConflictingChainLock(int nHeight, const uint
|
||||
|
||||
void CChainLocksHandler::Cleanup()
|
||||
{
|
||||
if (!masternodeSync.IsBlockchainSynced()) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(cs);
|
||||
if (GetTimeMillis() - lastCleanupTime < CLEANUP_INTERVAL) {
|
||||
|
Loading…
Reference in New Issue
Block a user