Skip to content

ForkChoice.reorgAllowed

NEW-ETC — no upstream or core-geth original.

File forkchoice_pow.go
Symbol ForkChoice.reorgAllowed
Ref etc/v1.17.3-full-node

NEW-ETC: Extension point for MESS artificial finality. Called by ReorgNeeded on every TD-warranted reorg. The reorgFilter callback is set by MESS to reject reorgs that exceed the allowed depth based on exponential subjective scoring.

// reorgAllowed checks whether a reorg that is warranted by TD should also
// pass the configured reorg filter (e.g. artificial finality), when set.
func (f *ForkChoice) reorgAllowed(current, extern *types.Header) (bool, error) {
    if f.reorgFilter == nil {
        return true, nil
    }
    if err := f.reorgFilter(current, extern); err != nil {
        return false, nil
    }
    return true, nil
}

← MESS