Page MenuHomePhabricator

FinalizeBlockAndInvalidate: just use chainActive
ClosedPublic

Authored by markblundeberg on Jan 26 2020, 08:15.

Details

Summary

Generally we're better off using the chainActive random access vector
than using the CBlockIndex linked lists, whenever we can.

Bonus: correctly handle the case when pindex is a child of Tip (i.e.,
when pindexFork == Tip), where it's not needed to invalidate anything.
Not sure why that would ever happen but why not do it right...

Test Plan

ninja check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

If the index is a child of tip, shouldn't we invalidate its siblings?

In any case, I'm not sure it matters much.

This revision is now accepted and ready to land.Jan 27 2020, 16:46