Skip to content

Commit 242c98f

Browse files
committed
coreapi: update after rebase
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
1 parent 5ea9a3c commit 242c98f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

core/coreapi/pin.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import (
44
"context"
55
"fmt"
66

7+
bserv "github.com/ipfs/go-ipfs/blockservice"
78
coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
89
caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
910
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
11+
offline "github.com/ipfs/go-ipfs/exchange/offline"
1012
merkledag "github.com/ipfs/go-ipfs/merkledag"
1113
pin "github.com/ipfs/go-ipfs/pin"
1214

13-
cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid"
15+
cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
16+
ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
1417
)
1518

1619
type PinAPI struct {
@@ -97,7 +100,9 @@ func (n *badNode) Err() error {
97100

98101
func (api *PinAPI) Verify(ctx context.Context) (<-chan coreiface.PinStatus, error) {
99102
visited := make(map[string]*pinStatus)
100-
getLinks := api.node.DAG.GetOfflineLinkService().GetLinks
103+
bs := api.node.Blocks.Blockstore()
104+
DAG := merkledag.NewDAGService(bserv.New(bs, offline.Exchange(bs)))
105+
getLinks := merkledag.GetLinksWithDAG(DAG)
101106
recPins := api.node.Pinning.RecursiveKeys()
102107

103108
var checkPin func(root *cid.Cid) *pinStatus
@@ -152,7 +157,7 @@ func (p *pinInfo) Type() string {
152157
return p.pinType
153158
}
154159

155-
func pinLsAll(typeStr string, ctx context.Context, pinning pin.Pinner, dag merkledag.DAGService) ([]coreiface.Pin, error) {
160+
func pinLsAll(typeStr string, ctx context.Context, pinning pin.Pinner, dag ipld.DAGService) ([]coreiface.Pin, error) {
156161

157162
keys := make(map[string]*pinInfo)
158163

@@ -171,7 +176,7 @@ func pinLsAll(typeStr string, ctx context.Context, pinning pin.Pinner, dag merkl
171176
if typeStr == "indirect" || typeStr == "all" {
172177
set := cid.NewSet()
173178
for _, k := range pinning.RecursiveKeys() {
174-
err := merkledag.EnumerateChildren(ctx, dag.GetLinks, k, set.Visit)
179+
err := merkledag.EnumerateChildren(ctx, merkledag.GetLinksWithDAG(dag), k, set.Visit)
175180
if err != nil {
176181
return nil, err
177182
}

0 commit comments

Comments
 (0)