mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-01 17:26:12 +00:00
refactor: inline constant return value of CDBWrapper::Erase and BlockTreeDB::WriteReindexing
Did both in this commit, since the return value of `WriteReindexing` was ignored anyway - which existed only because of the constant `Erase` being called
This commit is contained in:
parent
cdab9480e9
commit
e030240e90
@ -255,12 +255,11 @@ public:
|
||||
}
|
||||
|
||||
template <typename K>
|
||||
bool Erase(const K& key, bool fSync = false)
|
||||
void Erase(const K& key, bool fSync = false)
|
||||
{
|
||||
CDBBatch batch(*this);
|
||||
batch.Erase(key);
|
||||
WriteBatch(batch, fSync);
|
||||
return true;
|
||||
}
|
||||
|
||||
void WriteBatch(CDBBatch& batch, bool fSync = false);
|
||||
|
||||
@ -59,13 +59,12 @@ bool BlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo& info)
|
||||
return Read(std::make_pair(DB_BLOCK_FILES, nFile), info);
|
||||
}
|
||||
|
||||
bool BlockTreeDB::WriteReindexing(bool fReindexing)
|
||||
void BlockTreeDB::WriteReindexing(bool fReindexing)
|
||||
{
|
||||
if (fReindexing) {
|
||||
Write(DB_REINDEX_FLAG, uint8_t{'1'});
|
||||
return true;
|
||||
} else {
|
||||
return Erase(DB_REINDEX_FLAG);
|
||||
Erase(DB_REINDEX_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ public:
|
||||
bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo);
|
||||
bool ReadBlockFileInfo(int nFile, CBlockFileInfo& info);
|
||||
bool ReadLastBlockFile(int& nFile);
|
||||
bool WriteReindexing(bool fReindexing);
|
||||
void WriteReindexing(bool fReindexing);
|
||||
void ReadReindexing(bool& fReindexing);
|
||||
bool WriteFlag(const std::string& name, bool fValue);
|
||||
bool ReadFlag(const std::string& name, bool& fValue);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user