From 76b9564e31190a25015a4b433f4a6efdf1c49648 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Sun, 19 Nov 2023 13:39:35 -0800 Subject: [PATCH] sia: add links to blocks --- sia/store.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sia/store.go b/sia/store.go index 528392d..3f52068 100644 --- a/sia/store.go +++ b/sia/store.go @@ -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 }