diff options
author | Lawrence Nahum <lawrence@greenaddress.it> | 2017-08-21 13:22:23 +0200 |
---|---|---|
committer | Lawrence Nahum <lawrence@greenaddress.it> | 2017-09-06 09:25:00 +0200 |
commit | 467cbbcbfc8876ae0955aaf82f2af83c352ad27f (patch) | |
tree | e7d717271b2f5d6fcd6350cce74607c6ee513a6e /src | |
parent | 6866b4912b8013ed748d12250209f7079a3c92e6 (diff) | |
download | bitcoin-467cbbcbfc8876ae0955aaf82f2af83c352ad27f.tar.xz |
Add return value to DumpMempool
Diffstat (limited to 'src')
-rw-r--r-- | src/validation.cpp | 6 | ||||
-rw-r--r-- | src/validation.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 3b9636839d..ca0d6a8713 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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) 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) 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 diff --git a/src/validation.h b/src/validation.h index d0f6cdc135..d7f7b99ef8 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(); |