| 1485 | } |
| 1486 | |
| 1487 | bool ConnectBlockOnFinChain(CBlockIndex* pNewIndex, CValidationState& state) { |
| 1488 | if (pNewIndex && (chainActive.Tip() == pNewIndex->pprev)) { |
| 1489 | if (!ConnectTip(state, pNewIndex)) { |
| 1490 | if (state.IsInvalid()) { |
| 1491 | if (!state.CorruptionPossible()) // The block violates a consensus rule. |
| 1492 | InvalidChainFound(pNewIndex); |
| 1493 | |
| 1494 | } else { |
| 1495 | // A system error occurred (disk space, database error, ...). |
| 1496 | return false; |
| 1497 | } |
| 1498 | } |
| 1499 | |
| 1500 | mempool.ReScanMemPoolTx(); |
| 1501 | } |
| 1502 | return true; |
| 1503 | |
| 1504 | } |
| 1505 | // Try to activate to the most-work chain (thereby connecting it). |
| 1506 | bool ActivateBestChain(CValidationState &state, CBlockIndex* pNewIndex) { |
| 1507 | LOCK(cs_main); |
no test coverage detected