diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-08-03 18:25:05 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-08-03 18:25:05 +0000 |
commit | 2c06be915de967494920bdbb3096bbb455ccf99f (patch) | |
tree | da4dca822bdb75d871ee8d652b4aa306e62bff20 /db.cpp | |
parent | 6ff5f718b6a67797b2b3bab8905d607ad216ee21 (diff) |
new safety feature displays a warning message and locks down RPC if it detects a problem that may require an upgrade
-- version 0.3.8
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@122 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'db.cpp')
-rw-r--r-- | db.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -342,6 +342,16 @@ bool CTxDB::WriteHashBestChain(uint256 hashBestChain) return Write(string("hashBestChain"), hashBestChain);
}
+bool CTxDB::ReadBestInvalidWork(CBigNum& bnBestInvalidWork)
+{
+ return Read(string("bnBestInvalidWork"), bnBestInvalidWork);
+}
+
+bool CTxDB::WriteBestInvalidWork(CBigNum bnBestInvalidWork)
+{
+ return Write(string("bnBestInvalidWork"), bnBestInvalidWork);
+}
+
CBlockIndex* InsertBlockIndex(uint256 hash)
{
if (hash == 0)
@@ -446,6 +456,9 @@ bool CTxDB::LoadBlockIndex() bnBestChainWork = pindexBest->bnChainWork;
printf("LoadBlockIndex(): hashBestChain=%s height=%d\n", hashBestChain.ToString().substr(0,16).c_str(), nBestHeight);
+ // Load bnBestInvalidWork, OK if it doesn't exist
+ ReadBestInvalidWork(bnBestInvalidWork);
+
return true;
}
|