events: Change null block handling
This commit is contained in:
parent
1cfe67cb59
commit
d0850b8c2f
@ -53,7 +53,7 @@ func (e *heightEvents) headChangeAt(rev, app []*types.TipSet) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
revert(subh, nil)
|
revert(subh, ts)
|
||||||
subh--
|
subh--
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ func (e *heightEvents) headChangeAt(rev, app []*types.TipSet) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := apply(subh, nil); err != nil {
|
if err := apply(subh, ts); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +118,8 @@ func (e *heightEvents) headChangeAt(rev, app []*types.TipSet) error {
|
|||||||
// ChainAt invokes the specified `HeightHandler` when the chain reaches the
|
// ChainAt invokes the specified `HeightHandler` when the chain reaches the
|
||||||
// specified height+confidence threshold. If the chain is rolled-back under the
|
// specified height+confidence threshold. If the chain is rolled-back under the
|
||||||
// specified height, `RevertHandler` will be called.
|
// specified height, `RevertHandler` will be called.
|
||||||
|
//
|
||||||
|
// ts passed to handlers is the tipset at the specified, or above, if lower tipsets were null
|
||||||
func (e *heightEvents) ChainAt(hnd HeightHandler, rev RevertHandler, confidence int, h uint64) error {
|
func (e *heightEvents) ChainAt(hnd HeightHandler, rev RevertHandler, confidence int, h uint64) error {
|
||||||
e.lk.Lock()
|
e.lk.Lock()
|
||||||
defer e.lk.Unlock()
|
defer e.lk.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user