lotus/chain/stmgr/forks.go

23 lines
478 B
Go
Raw Normal View History

2019-12-19 18:46:30 +00:00
package stmgr
import (
"context"
2020-09-07 03:49:10 +00:00
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/chain/types"
2019-12-19 18:46:30 +00:00
)
var ForksAtHeight = map[abi.ChainEpoch]func(context.Context, *StateManager, types.StateTree) error{}
func (sm *StateManager) handleStateForks(ctx context.Context, st types.StateTree, height abi.ChainEpoch) (err error) {
f, ok := ForksAtHeight[height]
if ok {
err := f(ctx, sm, st)
if err != nil {
return err
}
2019-12-19 18:46:30 +00:00
}
return nil
2019-12-19 18:46:30 +00:00
}