Browse Source

Add return value to DumpMempool

0.16
Lawrence Nahum 7 years ago
parent
commit
467cbbcbfc
No known key found for this signature in database
GPG Key ID: 17AB8BC320B151D8
  1. 6
      src/validation.cpp
  2. 2
      src/validation.h

6
src/validation.cpp

@ -4332,7 +4332,7 @@ bool LoadMempool(void) @@ -4332,7 +4332,7 @@ bool LoadMempool(void)
return true;
}
void DumpMempool(void)
bool DumpMempool(void)
{
int64_t start = GetTimeMicros();
@ -4352,7 +4352,7 @@ void DumpMempool(void) @@ -4352,7 +4352,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);
@ -4376,7 +4376,9 @@ void DumpMempool(void) @@ -4376,7 +4376,9 @@ void DumpMempool(void)
LogPrintf("Dumped mempool: %gs to copy, %gs to dump\n", (mid-start)*MICRO, (last-mid)*MICRO);
} 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

2
src/validation.h

@ -475,7 +475,7 @@ static const unsigned int REJECT_HIGHFEE = 0x100; @@ -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();

Loading…
Cancel
Save