@@ -4,13 +4,16 @@ import (
4
4
"context"
5
5
"fmt"
6
6
7
+ bserv "github.com/ipfs/go-ipfs/blockservice"
7
8
coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface"
8
9
caopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options"
9
10
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
11
+ offline "github.com/ipfs/go-ipfs/exchange/offline"
10
12
merkledag "github.com/ipfs/go-ipfs/merkledag"
11
13
pin "github.com/ipfs/go-ipfs/pin"
12
14
13
- cid "gx/ipfs/QmeSrf6pzut73u6zLQkRFQ3ygt3k6XFT2kjdYP8Tnkwwyg/go-cid"
15
+ cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid"
16
+ ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
14
17
)
15
18
16
19
type PinAPI struct {
@@ -97,7 +100,9 @@ func (n *badNode) Err() error {
97
100
98
101
func (api * PinAPI ) Verify (ctx context.Context ) (<- chan coreiface.PinStatus , error ) {
99
102
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 )
101
106
recPins := api .node .Pinning .RecursiveKeys ()
102
107
103
108
var checkPin func (root * cid.Cid ) * pinStatus
@@ -152,7 +157,7 @@ func (p *pinInfo) Type() string {
152
157
return p .pinType
153
158
}
154
159
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 ) {
156
161
157
162
keys := make (map [string ]* pinInfo )
158
163
@@ -171,7 +176,7 @@ func pinLsAll(typeStr string, ctx context.Context, pinning pin.Pinner, dag merkl
171
176
if typeStr == "indirect" || typeStr == "all" {
172
177
set := cid .NewSet ()
173
178
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 )
175
180
if err != nil {
176
181
return nil , err
177
182
}
0 commit comments