Skip to content

Commit

Permalink
Call InitializeCurrentBlockTip and activeMasternodeManager->Init afte…
Browse files Browse the repository at this point in the history
…r 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.
  • Loading branch information
codablock authored and UdjinM6 committed Sep 12, 2018
1 parent 2a95dd3 commit 8a878bf
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8a878bf

Please sign in to comment.