Called both upon regular invalid block discovery *and* InvalidateBlock
| 1634 | |
| 1635 | // Called both upon regular invalid block discovery *and* InvalidateBlock |
| 1636 | void CChainState::InvalidChainFound(CBlockIndex* pindexNew) |
| 1637 | { |
| 1638 | AssertLockHeld(cs_main); |
| 1639 | if (!m_chainman.m_best_invalid || pindexNew->nChainWork > m_chainman.m_best_invalid->nChainWork) { |
| 1640 | m_chainman.m_best_invalid = pindexNew; |
| 1641 | } |
| 1642 | if (pindexBestHeader != nullptr && pindexBestHeader->GetAncestor(pindexNew->nHeight) == pindexNew) { |
| 1643 | pindexBestHeader = m_chain.Tip(); |
| 1644 | } |
| 1645 | |
| 1646 | LogPrintf("%s: invalid block=%s height=%d date=%s\n", __func__, |
| 1647 | pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, |
| 1648 | FormatISO8601DateTime(pindexNew->GetBlockTime())); |
| 1649 | CBlockIndex *tip = m_chain.Tip(); |
| 1650 | assert (tip); |
| 1651 | LogPrintf("%s: current best=%s height=%d date=%s\n", __func__, |
| 1652 | tip->GetBlockHash().ToString(), m_chain.Height(), |
| 1653 | FormatISO8601DateTime(tip->GetBlockTime())); |
| 1654 | CheckForkWarningConditions(); |
| 1655 | } |
| 1656 | |
| 1657 | // Same as InvalidChainFound, above, except not called directly from InvalidateBlock, |
| 1658 | // which does its own setBlockIndexCandidates management. |
nothing calls this directly
no test coverage detected