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
This commit is contained in:
Satoshi Nakamoto
2010-08-04 01:51:34 +00:00
committed by Gavin Andresen
parent 73aa262647
commit b34e8c3c36
8 changed files with 81 additions and 34 deletions

13
db.cpp
View File

@@ -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;
}