diff options
| author | Roy Badami <[email protected]> | 2014-07-07 22:06:21 +0100 |
|---|---|---|
| committer | Roy Badami <[email protected]> | 2014-07-07 22:06:21 +0100 |
| commit | 96df327834af3b55918adfac9b3f65adfc960b3a (patch) | |
| tree | 8bd199df46ea6f39f7094c0e7db2185b4d3f5d6d /src/txdb.cpp | |
| parent | Show bitcoin quantities with full precision, even in the presence of trailing... (diff) | |
| parent | Merge pull request #4480 (diff) | |
| download | discoin-96df327834af3b55918adfac9b3f65adfc960b3a.tar.xz discoin-96df327834af3b55918adfac9b3f65adfc960b3a.zip | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
src/qt/overviewpage.cpp
src/qt/transactiondesc.cpp
Diffstat (limited to 'src/txdb.cpp')
| -rw-r--r-- | src/txdb.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index cb92922a3..52cd96283 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -6,6 +6,7 @@ #include "txdb.h" #include "core.h" +#include "pow.h" #include "uint256.h" #include <stdint.h> @@ -53,11 +54,11 @@ bool CCoinsViewDB::SetBestBlock(const uint256 &hashBlock) { return db.WriteBatch(batch); } -bool CCoinsViewDB::BatchWrite(const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock) { +bool CCoinsViewDB::BatchWrite(const CCoinsMap &mapCoins, const uint256 &hashBlock) { LogPrint("coindb", "Committing %u changed transactions to coin database...\n", (unsigned int)mapCoins.size()); CLevelDBBatch batch; - for (std::map<uint256, CCoins>::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) + for (CCoinsMap::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++) BatchWriteCoins(batch, it->first, it->second); if (hashBlock != uint256(0)) BatchWriteHashBestChain(batch, hashBlock); @@ -73,12 +74,6 @@ bool CBlockTreeDB::WriteBlockIndex(const CDiskBlockIndex& blockindex) return Write(make_pair('b', blockindex.GetBlockHash()), blockindex); } -bool CBlockTreeDB::WriteBestInvalidWork(const CBigNum& bnBestInvalidWork) -{ - // Obsolete; only written for backward compatibility. - return Write('I', bnBestInvalidWork); -} - bool CBlockTreeDB::WriteBlockFileInfo(int nFile, const CBlockFileInfo &info) { return Write(make_pair('f', nFile), info); } @@ -218,8 +213,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nStatus = diskindex.nStatus; pindexNew->nTx = diskindex.nTx; - if (!pindexNew->CheckIndex()) - return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString()); + if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits)) + return error("LoadBlockIndex() : CheckProofOfWork failed: %s", pindexNew->ToString()); pcursor->Next(); } else { |