Do not use the redundant BestInvalidWork record in the block database.

As block index entries have a flag for marking invalid blocks, the
'best invalid work' information can be derived from there. In addition,
remove the global from main.h
This commit is contained in:
Pieter Wuille
2013-10-13 22:15:48 +02:00
parent ede3ee3348
commit 85eb2cef33
4 changed files with 13 additions and 21 deletions

View File

@@ -74,13 +74,9 @@ bool CBlockTreeDB::WriteBlockIndex(const CDiskBlockIndex& blockindex)
return Write(make_pair('b', blockindex.GetBlockHash()), blockindex);
}
bool CBlockTreeDB::ReadBestInvalidWork(CBigNum& bnBestInvalidWork)
{
return Read('I', bnBestInvalidWork);
}
bool CBlockTreeDB::WriteBestInvalidWork(const CBigNum& bnBestInvalidWork)
{
// Obsolete; only written for backward compatibility.
return Write('I', bnBestInvalidWork);
}