diff --git a/chain/events/observer.go b/chain/events/observer.go index 72b9deaee..446218585 100644 --- a/chain/events/observer.go +++ b/chain/events/observer.go @@ -125,7 +125,7 @@ func (o *observer) listenHeadChangesOnce(ctx context.Context) error { for changes := range notifs { if err := o.applyChanges(ctx, changes); err != nil { - return err + return xerrors.Errorf("failed to apply a change notification: %w", err) } } diff --git a/chain/store/store.go b/chain/store/store.go index 7343bdf9d..fd12b88a5 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -425,6 +425,11 @@ func (cs *ChainStore) MaybeTakeHeavierTipSet(ctx context.Context, ts *types.TipS } defer cs.heaviestLk.Unlock() + + if ts.Equals(cs.heaviest) { + return nil + } + w, err := cs.weight(ctx, cs.StateBlockstore(), ts) if err != nil { return err