Skip to content

Commit

Permalink
sia: add links to blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Nov 19, 2023
1 parent 25235c1 commit 76b9564
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sia/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ func (bs *RenterdBlockStore) Get(ctx context.Context, c cid.Cid) (blocks.Block,
}

node := merkledag.NodeWithData(buf)
for _, link := range cm.Links {
node.AddRawLink(link.Name, &format.Link{
Name: link.Name,
Size: link.Size,
Cid: link.CID,
})
}
if actual := node.Cid(); !actual.Equals(c) {
panic(fmt.Errorf("unexpected cid: requested %q got %q", c.Hash().B58String(), actual.Hash().B58String())) // developer error
}
Expand Down

0 comments on commit 76b9564

Please sign in to comment.