diff --git a/src/validation.cpp b/src/validation.cpp index 8bd23a0f1d721..434a4f1ea842a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4326,7 +4326,7 @@ bool LoadMempool(void) return true; } -void DumpMempool(void) +bool DumpMempool(void) { int64_t start = GetTimeMicros(); @@ -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); @@ -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 diff --git a/src/validation.h b/src/validation.h index edb8eab894b19..ea30465b21564 100644 --- a/src/validation.h +++ b/src/validation.h @@ -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();