From a7d45c5a7a46255631bb4814c3df27c3489ff3a0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 15 May 2012 13:36:25 -0400 Subject: [PATCH] Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk() --- src/db.cpp | 5 ----- src/db.h | 1 - src/main.h | 15 --------------- 3 files changed, 21 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 5bd0528202..ecf31de433 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -463,11 +463,6 @@ bool CTxDB::WriteBlockIndex(const CDiskBlockIndex& blockindex) return Write(make_pair(string("blockindex"), blockindex.GetBlockHash()), blockindex); } -bool CTxDB::EraseBlockIndex(uint256 hash) -{ - return Erase(make_pair(string("blockindex"), hash)); -} - bool CTxDB::ReadHashBestChain(uint256& hashBestChain) { return Read(string("hashBestChain"), hashBestChain); diff --git a/src/db.h b/src/db.h index 3ce8f1758f..db8ae8f274 100644 --- a/src/db.h +++ b/src/db.h @@ -285,7 +285,6 @@ public: bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex); bool ReadDiskTx(COutPoint outpoint, CTransaction& tx); bool WriteBlockIndex(const CDiskBlockIndex& blockindex); - bool EraseBlockIndex(uint256 hash); bool ReadHashBestChain(uint256& hashBestChain); bool WriteHashBestChain(uint256 hashBestChain); bool ReadBestInvalidWork(CBigNum& bnBestInvalidWork); diff --git a/src/main.h b/src/main.h index 5ac5547a3e..37af4ff907 100644 --- a/src/main.h +++ b/src/main.h @@ -1130,21 +1130,6 @@ public: return CheckProofOfWork(GetBlockHash(), nBits); } - bool EraseBlockFromDisk() - { - // Open history file - CAutoFile fileout = CAutoFile(OpenBlockFile(nFile, nBlockPos, "rb+"), SER_DISK, CLIENT_VERSION); - if (!fileout) - return false; - - // Overwrite with empty null block - CBlock block; - block.SetNull(); - fileout << block; - - return true; - } - enum { nMedianTimeSpan=11 }; int64 GetMedianTimePast() const