From 27f99b6d63b7ca2d4fcb9db3e88ed66c024c59d5 Mon Sep 17 00:00:00 2001 From: Fabian Jahr Date: Tue, 1 Oct 2024 01:38:38 +0200 Subject: [PATCH] validation: Don't assume m_chain_tx_count in GuessVerificationProgress In the context of an a descriptor import during assumeutxo background sync, the progress can not be estimated due to m_chain_tx_count being set to 0. --- src/validation.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 3e8a7cf520e..25ba5107603 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5623,9 +5623,8 @@ double ChainstateManager::GuessVerificationProgress(const CBlockIndex* pindex) c return 0.0; } - if (!Assume(pindex->m_chain_tx_count > 0)) { - LogWarning("Internal bug detected: block %d has unset m_chain_tx_count (%s %s). Please report this issue here: %s\n", - pindex->nHeight, CLIENT_NAME, FormatFullVersion(), CLIENT_BUGREPORT); + if (pindex->m_chain_tx_count == 0) { + LogDebug(BCLog::VALIDATION, "Block %d has unset m_chain_tx_count. Unable to estimate verification progress.\n", pindex->nHeight); return 0.0; }