Browse Source

Merge pull request #1316 from jgarzik/dead-code

Remove dead code: CTxDB::EraseBlockIndex(), CBlockIndex::EraseBlockFromDisk()
0.8
Jeff Garzik 13 years ago
parent
commit
d17ac27a72
  1. 5
      src/db.cpp
  2. 1
      src/db.h
  3. 15
      src/main.h

5
src/db.cpp

@ -461,11 +461,6 @@ bool CTxDB::WriteBlockIndex(const CDiskBlockIndex& blockindex) @@ -461,11 +461,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);

1
src/db.h

@ -285,7 +285,6 @@ public: @@ -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);

15
src/main.h

@ -1124,21 +1124,6 @@ public: @@ -1124,21 +1124,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

Loading…
Cancel
Save