diff options
| author | Jeff Garzik <[email protected]> | 2013-05-30 08:04:02 -0700 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2013-05-30 08:04:02 -0700 |
| commit | 3fad76bf838f7102838985863f04e621a77dffa6 (patch) | |
| tree | 71b189f546f8c14404f81c2fe64be942c2e1b449 /src/init.cpp | |
| parent | Merge pull request #2625 from gavinandresen/walletlock_asio (diff) | |
| parent | Check for correct genesis (diff) | |
| download | discoin-3fad76bf838f7102838985863f04e621a77dffa6.tar.xz discoin-3fad76bf838f7102838985863f04e621a77dffa6.zip | |
Merge pull request #2642 from sipa/rightgenesis
Check for correct genesis
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 2175f73d7..aaa7d4320 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -866,6 +866,11 @@ bool AppInit2(boost::thread_group& threadGroup) 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) if (!InitBlockIndex()) { strLoadError = _("Error initializing block database"); |