handle getting state for genesis block
This commit is contained in:
parent
1ec5c61015
commit
65def6cc58
@ -59,6 +59,11 @@ func (sm *StateManager) TipSetState(cids []cid.Cid) (cid.Cid, cid.Cid, error) {
|
|||||||
return cid.Undef, cid.Undef, err
|
return cid.Undef, cid.Undef, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ts.Height() == 0 {
|
||||||
|
// NB: Genesis block is a weird case here...
|
||||||
|
return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil
|
||||||
|
}
|
||||||
|
|
||||||
st, rec, err := sm.computeTipSetState(ctx, ts.Blocks(), nil)
|
st, rec, err := sm.computeTipSetState(ctx, ts.Blocks(), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, cid.Undef, err
|
return cid.Undef, cid.Undef, err
|
||||||
|
@ -2,6 +2,7 @@ package full
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go.uber.org/fx"
|
"go.uber.org/fx"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user