mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-05-02 03:02:54 -04:00
Do not attempt to save a nil state (#4758)
This commit is contained in:
@@ -106,6 +106,9 @@ func (k *Store) GenesisState(ctx context.Context) (*state.BeaconState, error) {
|
||||
func (k *Store) SaveState(ctx context.Context, state *state.BeaconState, blockRoot [32]byte) error {
|
||||
ctx, span := trace.StartSpan(ctx, "BeaconDB.SaveState")
|
||||
defer span.End()
|
||||
if state == nil {
|
||||
return errors.New("nil state")
|
||||
}
|
||||
enc, err := encode(state.InnerStateUnsafe())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user