lotus/chain/stmgr/forks.go

23 lines
483 B
Go
Raw Normal View History

2019-12-19 18:46:30 +00:00
package stmgr
import (
"context"
"github.com/filecoin-project/lotus/chain/types"
2020-02-08 02:18:32 +00:00
"github.com/filecoin-project/specs-actors/actors/abi"
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
}