In commit “index: ignore BlockConnected if pindex is in chain” (270579f85fbe8cf97a9f506a258ad3ed865fcbeb)
Seems like code would be more straightforward without skip_write
variable. Maybe just:
0if (best_block_index->GetAncestor(pindex->nHeight) == pindex) {
1 LogPrintf("%s: WARNING: Block %s does is already-processed ancestor of " /* Continued */
2 "known best chain (tip=%s); not updating index\n",
3 __func__, pindex->GetBlockHash().ToString(),
4 best_block_index->GetBlockHash().ToString());
5 return;
6}