mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Add return value to DumpMempool
This commit is contained in:
parent
6866b4912b
commit
467cbbcbfc
2 changed files with 5 additions and 3 deletions
|
@ -4332,7 +4332,7 @@ bool LoadMempool(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DumpMempool(void)
|
bool DumpMempool(void)
|
||||||
{
|
{
|
||||||
int64_t start = GetTimeMicros();
|
int64_t start = GetTimeMicros();
|
||||||
|
|
||||||
|
@ -4352,7 +4352,7 @@ void DumpMempool(void)
|
||||||
try {
|
try {
|
||||||
FILE* filestr = fsbridge::fopen(GetDataDir() / "mempool.dat.new", "wb");
|
FILE* filestr = fsbridge::fopen(GetDataDir() / "mempool.dat.new", "wb");
|
||||||
if (!filestr) {
|
if (!filestr) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);
|
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);
|
LogPrintf("Dumped mempool: %gs to copy, %gs to dump\n", (mid-start)*MICRO, (last-mid)*MICRO);
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what());
|
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
|
//! Guess how far we are in the verification process at the given block index
|
||||||
|
|
|
@ -475,7 +475,7 @@ static const unsigned int REJECT_HIGHFEE = 0x100;
|
||||||
CBlockFileInfo* GetBlockFileInfo(size_t n);
|
CBlockFileInfo* GetBlockFileInfo(size_t n);
|
||||||
|
|
||||||
/** Dump the mempool to disk. */
|
/** Dump the mempool to disk. */
|
||||||
void DumpMempool();
|
bool DumpMempool();
|
||||||
|
|
||||||
/** Load the mempool from disk. */
|
/** Load the mempool from disk. */
|
||||||
bool LoadMempool();
|
bool LoadMempool();
|
||||||
|
|
Loading…
Add table
Reference in a new issue