Skip to content

Commit 467cbbc

Browse files
author
Lawrence Nahum
committed
Add return value to DumpMempool
1 parent 6866b49 commit 467cbbc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/validation.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4332,7 +4332,7 @@ bool LoadMempool(void)
43324332
return true;
43334333
}
43344334

4335-
void DumpMempool(void)
4335+
bool DumpMempool(void)
43364336
{
43374337
int64_t start = GetTimeMicros();
43384338

@@ -4352,7 +4352,7 @@ void DumpMempool(void)
43524352
try {
43534353
FILE* filestr = fsbridge::fopen(GetDataDir() / "mempool.dat.new", "wb");
43544354
if (!filestr) {
4355-
return;
4355+
return false;
43564356
}
43574357

43584358
CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);
@@ -4376,7 +4376,9 @@ void DumpMempool(void)
43764376
LogPrintf("Dumped mempool: %gs to copy, %gs to dump\n", (mid-start)*MICRO, (last-mid)*MICRO);
43774377
} catch (const std::exception& e) {
43784378
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what());
4379+
return false;
43794380
}
4381+
return true;
43804382
}
43814383

43824384
//! Guess how far we are in the verification process at the given block index

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static const unsigned int REJECT_HIGHFEE = 0x100;
475475
CBlockFileInfo* GetBlockFileInfo(size_t n);
476476

477477
/** Dump the mempool to disk. */
478-
void DumpMempool();
478+
bool DumpMempool();
479479

480480
/** Load the mempool from disk. */
481481
bool LoadMempool();

0 commit comments

Comments
 (0)