Merge pull request #1145 from tgflynn/v0.12.1.x-mn-startup-fix
Exit if cache files can't be read
This commit is contained in:
commit
79af6fddea
16
src/init.cpp
16
src/init.cpp
@ -1860,19 +1860,27 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
uiInterface.InitMessage(_("Loading masternode cache..."));
|
uiInterface.InitMessage(_("Loading masternode cache..."));
|
||||||
CFlatDB<CMasternodeMan> flatdb1("mncache.dat", "magicMasternodeCache");
|
CFlatDB<CMasternodeMan> flatdb1("mncache.dat", "magicMasternodeCache");
|
||||||
flatdb1.Load(mnodeman);
|
if(!flatdb1.Load(mnodeman)) {
|
||||||
|
return InitError("Failed to load masternode cache from mncache.dat");
|
||||||
|
}
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Loading masternode payment cache..."));
|
uiInterface.InitMessage(_("Loading masternode payment cache..."));
|
||||||
CFlatDB<CMasternodePayments> flatdb2("mnpayments.dat", "magicMasternodePaymentsCache");
|
CFlatDB<CMasternodePayments> flatdb2("mnpayments.dat", "magicMasternodePaymentsCache");
|
||||||
flatdb2.Load(mnpayments);
|
if(!flatdb2.Load(mnpayments)) {
|
||||||
|
return InitError("Failed to load masternode payments cache from mnpayments.dat");
|
||||||
|
}
|
||||||
|
|
||||||
CFlatDB<CGovernanceManager> flatdb3("governance.dat", "magicGovernanceCache");
|
CFlatDB<CGovernanceManager> flatdb3("governance.dat", "magicGovernanceCache");
|
||||||
flatdb3.Load(governance);
|
if(!flatdb3.Load(governance)) {
|
||||||
|
return InitError("Failed to load governance cache from governance.dat");
|
||||||
|
}
|
||||||
governance.ClearSeen();
|
governance.ClearSeen();
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Loading fullfiled requests cache..."));
|
uiInterface.InitMessage(_("Loading fullfiled requests cache..."));
|
||||||
CFlatDB<CNetFulfilledRequestManager> flatdb4("netfulfilled.dat", "magicFulfilledCache");
|
CFlatDB<CNetFulfilledRequestManager> flatdb4("netfulfilled.dat", "magicFulfilledCache");
|
||||||
flatdb4.Load(netfulfilledman);
|
if(!flatdb4.Load(netfulfilledman)) {
|
||||||
|
return InitError("Failed to load fulfilled requests cache from netfulfilled.dat");
|
||||||
|
}
|
||||||
|
|
||||||
// ********************************************************* Step 11c: update block tip in Dash modules
|
// ********************************************************* Step 11c: update block tip in Dash modules
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user