LastCommonAncestor

Find the forking point between two chain tips.

Synopsis

Declared in <chain.h>

CBlockIndex const*
LastCommonAncestor(
    CBlockIndex const* pa,
    CBlockIndex const* pb);

Return Value

The most recent common ancestor of the two entries, or nullptr if none.

Parameters

NameDescription
paThe first block index entry.
pbThe second block index entry.