Skip to content

Commit e669dca

Browse files
authored
fix: startup with disabled index provider (#1604)
1 parent 9492412 commit e669dca

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

node/modules/graphsync.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ func (p *LinkSystemProv) LinkSys() *ipld.LinkSystem {
7070
}
7171

7272
func SetLinkSystem(proxy *LinkSystemProv, prov provider.Interface) {
73-
e := prov.(*engine.Engine)
74-
proxy.LinkSystem = e.LinkSystem()
73+
e, ok := prov.(*engine.Engine)
74+
if ok {
75+
proxy.LinkSystem = e.LinkSystem()
76+
}
7577
}
7678

7779
// RetrievalGraphsync creates a graphsync instance used to serve retrievals.

retrievalmarket/server/gsunpaidretrieval.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (g *GraphsyncUnpaidRetrieval) Start(ctx context.Context) error {
120120
g.ctx = ctx
121121
g.validator.ctx = ctx
122122

123-
if g.linkSystem != nil {
123+
if g.linkSystem != nil && g.linkSystem.LinkSys() != nil {
124124
// The index provider uses graphsync to fetch advertisements.
125125
// We need to tell graphsync to use a different IPLD Link System to provide
126126
// the advertisements (instead of using the blockstore).

0 commit comments

Comments
 (0)