Call InitializeCurrentBlockTip and activeMasternodeManager->Init after importing has finished (#2286)

While importing, IsInitialBlockDownload always returns true, meaning that
the call to UpdatedBlockTip will also receive true as fInitialDownload.

UpdatedBlockTip is never called again unless a block is mined.
Mining of new blocks in regtest however only starts after mnsync has
finished, which will never happen as it waits for the next call to
UpdatedBlockTip.
This commit is contained in:
Alexander Block 2018-09-12 13:13:17 +02:00 committed by UdjinM6
parent 2a95dd30c5
commit 8a878bfcfd

View File

@ -799,6 +799,15 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
StartShutdown();
}
} // End scope of CImportingNow
// force UpdatedBlockTip to initialize nCachedBlockHeight for DS, MN payments and budgets
// but don't call it directly to prevent triggering of other listeners like zmq etc.
// GetMainSignals().UpdatedBlockTip(chainActive.Tip());
pdsNotificationInterface->InitializeCurrentBlockTip();
if (activeMasternodeManager && fDIP0003ActiveAtTip)
activeMasternodeManager->Init();
LoadMempool();
fDumpMempoolLater = !fRequestShutdown;
}
@ -2001,18 +2010,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
// ********************************************************* Step 11c: update block tip in Dash modules
// force UpdatedBlockTip to initialize nCachedBlockHeight for DS, MN payments and budgets
// but don't call it directly to prevent triggering of other listeners like zmq etc.
// GetMainSignals().UpdatedBlockTip(chainActive.Tip());
pdsNotificationInterface->InitializeCurrentBlockTip();
if (activeMasternodeManager && fDIP0003ActiveAtTip)
activeMasternodeManager->Init();
// ********************************************************* Step 11d: schedule Dash-specific tasks
// ********************************************************* Step 11c: schedule Dash-specific tasks
if (!fLiteMode) {
scheduler.scheduleEvery(boost::bind(&CNetFulfilledRequestManager::DoMaintenance, boost::ref(netfulfilledman)), 60);