Skip to content

Commit b9f04be

Browse files
committed
mempool: Log added for dumping mempool transactions to disk
1 parent 1d334d8 commit b9f04be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/kernel/mempool_persist.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
184184
}
185185
file.SetXor(xor_key);
186186

187-
file << (uint64_t)vinfo.size();
187+
uint64_t mempool_transactions_to_write(vinfo.size());
188+
file << mempool_transactions_to_write;
189+
LogInfo("Writing %u mempool transactions to disk...\n", mempool_transactions_to_write);
188190
for (const auto& i : vinfo) {
189191
file << TX_WITH_WITNESS(*(i.tx));
190192
file << int64_t{count_seconds(i.m_time)};
@@ -205,9 +207,10 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
205207
}
206208
auto last = SteadyClock::now();
207209

208-
LogPrintf("Dumped mempool: %.3fs to copy, %.3fs to dump\n",
210+
LogInfo("Dumped mempool: %.3fs to copy, %.3fs to dump, %d bytes dumped to file\n",
209211
Ticks<SecondsDouble>(mid - start),
210-
Ticks<SecondsDouble>(last - mid));
212+
Ticks<SecondsDouble>(last - mid),
213+
fs::file_size(dump_path));
211214
} catch (const std::exception& e) {
212215
LogPrintf("Failed to dump mempool: %s. Continuing anyway.\n", e.what());
213216
return false;

0 commit comments

Comments
 (0)