Skip to content

Commit

Permalink
store: fix error handling around tipset key blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Nov 11, 2022
1 parent 9123628 commit f438b1c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions chain/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,14 +647,20 @@ func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet)

if err := cs.writeHead(ctx, ts); err != nil {
log.Errorf("failed to write chain head: %s", err)
return nil
return err
}

tskBlk, err := ts.Key().ToStorageBlock()
if err != nil {
log.Errorf("failed to create a block from tsk: %s", ts.Key())
return err
}

err = cs.chainLocalBlockstore.Put(ctx, tskBlk)
if err != nil {
log.Errorf("failed to put block for tsk: %s", ts.Key())
return err
}
_ = cs.chainLocalBlockstore.Put(ctx, tskBlk)

return nil
}
Expand Down

0 comments on commit f438b1c

Please sign in to comment.