Skip to content

Commit

Permalink
CBlockTreeDB::ReadReindexing => CBlockTreeDB::IsReindexing
Browse files Browse the repository at this point in the history
Summary: This is just nicer API.

Test Plan:
  ninja all check-all

Reindex a node.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6564
  • Loading branch information
deadalnix authored and ftrader committed Jul 3, 2020
1 parent 6342f98 commit 4cb4c83
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ bool AppInitMain(Config &config, RPCServer &rpcServer,
int64_t nStart = 0;
bool fLoaded = false;
while (!fLoaded && !ShutdownRequested()) {
bool fReset = fReindex;
const bool fReset = fReindex;
std::string strLoadError;

uiInterface.InitMessage(_("Loading block index..."));
Expand Down
4 changes: 2 additions & 2 deletions src/txdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ bool CBlockTreeDB::WriteReindexing(bool fReindexing) {
}
}

void CBlockTreeDB::ReadReindexing(bool &fReindexing) {
fReindexing = Exists(DB_REINDEX_FLAG);
bool CBlockTreeDB::IsReindexing() const {
return Exists(DB_REINDEX_FLAG);
}

bool CBlockTreeDB::ReadLastBlockFile(int &nFile) {
Expand Down
2 changes: 1 addition & 1 deletion src/txdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class CBlockTreeDB : public CDBWrapper {
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info);
bool ReadLastBlockFile(int &nFile);
bool WriteReindexing(bool fReindexing);
void ReadReindexing(bool &fReindexing);
bool IsReindexing() const;
bool WriteFlag(const std::string &name, bool fValue);
bool ReadFlag(const std::string &name, bool &fValue);
bool LoadBlockIndexGuts(
Expand Down
4 changes: 1 addition & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4709,9 +4709,7 @@ static bool LoadBlockIndexDB(const Config &config)
}

// Check whether we need to continue reindexing
bool fReindexing = false;
pblocktree->ReadReindexing(fReindexing);
if (fReindexing) {
if (pblocktree->IsReindexing()) {
fReindex = true;
}

Expand Down

0 comments on commit 4cb4c83

Please sign in to comment.