mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
Handle rename failure in DumpMempool(...) by using RenameOver(...) return value
This commit is contained in:
parent
e2ff5e7b35
commit
9429a398e2
1 changed files with 3 additions and 1 deletions
|
@ -5110,7 +5110,9 @@ bool DumpMempool(const CTxMemPool& pool)
|
|||
if (!FileCommit(file.Get()))
|
||||
throw std::runtime_error("FileCommit failed");
|
||||
file.fclose();
|
||||
RenameOver(GetDataDir() / "mempool.dat.new", GetDataDir() / "mempool.dat");
|
||||
if (!RenameOver(GetDataDir() / "mempool.dat.new", GetDataDir() / "mempool.dat")) {
|
||||
throw std::runtime_error("Rename failed");
|
||||
}
|
||||
int64_t last = GetTimeMicros();
|
||||
LogPrintf("Dumped mempool: %gs to copy, %gs to dump\n", (mid-start)*MICRO, (last-mid)*MICRO);
|
||||
} catch (const std::exception& e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue