mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Check for correct genesis
At startup, check that the expected genesis is loaded. This should prevent cases where accidentally a datadir from the wrong network is loaded (testnet vs mainnet, e.g.).
This commit is contained in:
parent
5b5d399593
commit
5d274c9927
@ -862,6 +862,11 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the loaded chain has a wrong genesis, bail out immediately
|
||||||
|
// (we're likely using a testnet datadir, or the other way around).
|
||||||
|
if (!mapBlockIndex.empty() && pindexGenesisBlock == NULL)
|
||||||
|
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
|
||||||
|
|
||||||
// Initialize the block index (no-op if non-empty database was already loaded)
|
// Initialize the block index (no-op if non-empty database was already loaded)
|
||||||
if (!InitBlockIndex()) {
|
if (!InitBlockIndex()) {
|
||||||
strLoadError = _("Error initializing block database");
|
strLoadError = _("Error initializing block database");
|
||||||
|
Loading…
Reference in New Issue
Block a user