mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
log: split assumevalid ancestry-failure-reason message
When the assumevalid ancestry check fails, log a precise reason: - "block height above assumevalid height" if the block is above the assumevalid block (the default reason) - "block not in of assumevalid chain" otherwise The new split was added under the existing condition to simplify conceptually that the two cases are related. It could still be useful to know when the block is just above the assumevalid block or when it's not even on the same chain. Update the functional test to assert the new reason strings. No behavior change. Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
This commit is contained in:
@@ -2437,7 +2437,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
if (it == m_blockman.m_block_index.end()) {
|
||||
script_check_reason = "assumevalid hash not in headers";
|
||||
} else if (it->second.GetAncestor(pindex->nHeight) != pindex) {
|
||||
script_check_reason = "block not in assumevalid chain";
|
||||
script_check_reason = (pindex->nHeight > it->second.nHeight) ? "block height above assumevalid height" : "block not in assumevalid chain";
|
||||
} else if (m_chainman.m_best_header->GetAncestor(pindex->nHeight) != pindex) {
|
||||
script_check_reason = "block not in best header chain";
|
||||
} else if (m_chainman.m_best_header->nChainWork < m_chainman.MinimumChainWork()) {
|
||||
|
||||
Reference in New Issue
Block a user