| 1615 | } |
| 1616 | |
| 1617 | void CChainState::CheckForkWarningConditions() |
| 1618 | { |
| 1619 | AssertLockHeld(cs_main); |
| 1620 | |
| 1621 | // Before we get past initial download, we cannot reliably alert about forks |
| 1622 | // (we assume we don't get stuck on a fork before finishing our initial sync) |
| 1623 | if (IsInitialBlockDownload()) { |
| 1624 | return; |
| 1625 | } |
| 1626 | |
| 1627 | if (m_chainman.m_best_invalid && m_chainman.m_best_invalid->nChainWork > m_chain.Tip()->nChainWork + (GetBlockProof(*m_chain.Tip()) * 6)) { |
| 1628 | LogPrintf("%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\nChain state database corruption likely.\n", __func__); |
| 1629 | SetfLargeWorkInvalidChainFound(true); |
| 1630 | } else { |
| 1631 | SetfLargeWorkInvalidChainFound(false); |
| 1632 | } |
| 1633 | } |
| 1634 | |
| 1635 | // Called both upon regular invalid block discovery *and* InvalidateBlock |
| 1636 | void CChainState::InvalidChainFound(CBlockIndex* pindexNew) |
nothing calls this directly
no test coverage detected