| 1949 | } |
| 1950 | |
| 1951 | void Chainstate::CheckForkWarningConditions() |
| 1952 | { |
| 1953 | AssertLockHeld(cs_main); |
| 1954 | |
| 1955 | if (this->GetRole().historical) { |
| 1956 | return; |
| 1957 | } |
| 1958 | |
| 1959 | if (m_chainman.m_best_invalid && m_chainman.m_best_invalid->nChainWork > m_chain.Tip()->nChainWork + (GetBlockProof(*m_chain.Tip()) * 6)) { |
| 1960 | LogWarning("Found invalid chain more than 6 blocks longer than our best chain. This could be due to database corruption or consensus incompatibility with peers."); |
| 1961 | m_chainman.GetNotifications().warningSet( |
| 1962 | kernel::Warning::LARGE_WORK_INVALID_CHAIN, |
| 1963 | _("Warning: Found invalid chain more than 6 blocks longer than our best chain. This could be due to database corruption or consensus incompatibility with peers.")); |
| 1964 | } else { |
| 1965 | m_chainman.GetNotifications().warningUnset(kernel::Warning::LARGE_WORK_INVALID_CHAIN); |
| 1966 | } |
| 1967 | } |
| 1968 | |
| 1969 | // Called both upon regular invalid block discovery *and* InvalidateBlock |
| 1970 | void Chainstate::InvalidChainFound(CBlockIndex* pindexNew) |
nothing calls this directly
no test coverage detected