aboutsummaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorkevkevin <oapallikunnel@gmail.com>2024-02-07 06:07:31 -0600
committerkevkevin <oapallikunnel@gmail.com>2024-03-27 07:18:49 -0500
commitb9f04be870c948f071216fba8402a2c5395a336b (patch)
treeeaf72ff6c5e029cf2bbe871677a7d82a9c9c3098 /src/kernel
parent1d334d830f9423caef0a230dc62e4458a56d3bbe (diff)
mempool: Log added for dumping mempool transactions to disk
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/mempool_persist.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/mempool_persist.cpp b/src/kernel/mempool_persist.cpp
index 57c5168e9f..ec9f78369c 100644
--- a/src/kernel/mempool_persist.cpp
+++ b/src/kernel/mempool_persist.cpp
@@ -184,7 +184,9 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
}
file.SetXor(xor_key);
- file << (uint64_t)vinfo.size();
+ uint64_t mempool_transactions_to_write(vinfo.size());
+ file << mempool_transactions_to_write;
+ LogInfo("Writing %u mempool transactions to disk...\n", mempool_transactions_to_write);
for (const auto& i : vinfo) {
file << TX_WITH_WITNESS(*(i.tx));
file << int64_t{count_seconds(i.m_time)};
@@ -205,9 +207,10 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
}
auto last = SteadyClock::now();
- LogPrintf("Dumped mempool: %.3fs to copy, %.3fs to dump\n",
+ LogInfo("Dumped mempool: %.3fs to copy, %.3fs to dump, %d bytes dumped to file\n",
Ticks<SecondsDouble>(mid - start),
- Ticks<SecondsDouble>(last - mid));
+ Ticks<SecondsDouble>(last - mid),
+ fs::file_size(dump_path));
} catch (const std::exception& e) {
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what());
return false;