Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add return value to DumpMempool
Github-Pull: bitcoin#11099
Rebased-From: 609e818
  • Loading branch information
greenaddress authored and luke-jr committed Sep 2, 2017
1 parent c2704ec commit c263bec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/validation.cpp
Expand Up @@ -4326,7 +4326,7 @@ bool LoadMempool(void)
return true;
}

void DumpMempool(void)
bool DumpMempool(void)
{
int64_t start = GetTimeMicros();

Expand All @@ -4346,7 +4346,7 @@ void DumpMempool(void)
try {
FILE* filestr = fsbridge::fopen(GetDataDir() / "mempool.dat.new", "wb");
if (!filestr) {
return;
return false;
}

CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);
Expand All @@ -4370,7 +4370,9 @@ void DumpMempool(void)
LogPrintf("Dumped mempool: %gs to copy, %gs to dump\n", (mid-start)*0.000001, (last-mid)*0.000001);
} catch (const std::exception& e) {
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what());
return false;
}
return true;
}

//! Guess how far we are in the verification process at the given block index
Expand Down
2 changes: 1 addition & 1 deletion src/validation.h
Expand Up @@ -475,7 +475,7 @@ static const unsigned int REJECT_HIGHFEE = 0x100;
CBlockFileInfo* GetBlockFileInfo(size_t n);

/** Dump the mempool to disk. */
void DumpMempool();
bool DumpMempool();

/** Load the mempool from disk. */
bool LoadMempool();
Expand Down

0 comments on commit c263bec

Please sign in to comment.