aboutsummaryrefslogtreecommitdiff
path: root/db.cpp
diff options
context:
space:
mode:
authorSatoshi Nakamoto <satoshin@gmx.com>2010-08-04 01:51:34 +0000
committerGavin Andresen <gavinandresen@gmail.com>2010-08-04 01:51:34 +0000
commitb34e8c3c369331189c01bcbb7682af9d7daa42cd (patch)
treee6da267e5bfb4fde1472c32154f73ba7a73b74b7 /db.cpp
parent73aa262647ff9948eaf95e83236ec323347e95d0 (diff)
downloadbitcoin-b34e8c3c369331189c01bcbb7682af9d7daa42cd.tar.xz
new safety feature displays a warning message and locks down RPC if it detects a problem that may require an upgradev0.3.8
-- version 0.3.8
Diffstat (limited to 'db.cpp')
-rw-r--r--db.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/db.cpp b/db.cpp
index fa4ae9026f..d773d7ad3a 100644
--- a/db.cpp
+++ b/db.cpp
@@ -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;
}