HomePhabricator

FinalizeBlockAndInvalidate: just use chainActive

Description

FinalizeBlockAndInvalidate: just use chainActive

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

Reviewers: fpelliccioni, jasonbcox, #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5069

Details

Provenance
Mark Lundeberg <markblundeberg@users.noreply.github.com>Authored on Jan 26 2020, 08:14
markblundebergPushed on Jan 28 2020, 11:53
Reviewer
Restricted Project
Differential Revision
D5069: FinalizeBlockAndInvalidate: just use chainActive
Parents
rABC11553877caa8: ConnectBlock : count sigops in one place
Branches
Unknown
Tags
Unknown

Event Timeline

Mark Lundeberg <markblundeberg@users.noreply.github.com> committed rABC02caabba2898: FinalizeBlockAndInvalidate: just use chainActive (authored by Mark Lundeberg <markblundeberg@users.noreply.github.com>).Jan 28 2020, 11:53