log: print reason for why should_write was triggered in FlushStateToDisk
Co-authored-by: Jon Atack <jon@atack.com>
This commit is contained in:
1 parent
2df824f4e6
commit
53e9b71b2f
2 files changed
+5
-1
No files matched your search
@@ -2874,6 +2874,9 @@ bool Chainstate::FlushStateToDisk(
|
|||||||
bool should_write = (mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicWrite || fFlushForPrune;
|
bool should_write = (mode == FlushStateMode::ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicWrite || fFlushForPrune;
|
||||||
// Write blocks, block index and best chain related state to disk.
|
// Write blocks, block index and best chain related state to disk.
|
||||||
if (should_write) {
|
if (should_write) {
|
||||||
|
LogDebug(BCLog::COINDB, "Writing chainstate to disk: flush mode=%s, prune=%d, large=%d, critical=%d, periodic=%d",
|
||||||
|
FlushStateModeNames[size_t(mode)], fFlushForPrune, fCacheLarge, fCacheCritical, fPeriodicWrite);
|
||||||
|
|
||||||
// Ensure we can write block index
|
// Ensure we can write block index
|
||||||
if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) {
|
if (!CheckDiskSpace(m_blockman.m_opts.blocks_dir)) {
|
||||||
return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));
|
return FatalError(m_chainman.GetNotifications(), state, _("Disk space is too low!"));
|
||||||
|
|||||||
+2
-1
@@ -437,7 +437,8 @@ enum DisconnectResult
|
|||||||
class ConnectTrace;
|
class ConnectTrace;
|
||||||
|
|
||||||
/** @see Chainstate::FlushStateToDisk */
|
/** @see Chainstate::FlushStateToDisk */
|
||||||
enum class FlushStateMode {
|
inline constexpr std::array FlushStateModeNames{"NONE", "IF_NEEDED", "PERIODIC", "ALWAYS"};
|
||||||
|
enum class FlushStateMode: uint8_t {
|
||||||
NONE,
|
NONE,
|
||||||
IF_NEEDED,
|
IF_NEEDED,
|
||||||
PERIODIC,
|
PERIODIC,
|
||||||
|
|||||||
Reference in new issue
Block a user