diff options
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; } |