Skip to content

Commit

Permalink
fix: startup with disabled index provider (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored Aug 4, 2023
1 parent 9492412 commit e669dca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions node/modules/graphsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ func (p *LinkSystemProv) LinkSys() *ipld.LinkSystem {
}

func SetLinkSystem(proxy *LinkSystemProv, prov provider.Interface) {
e := prov.(*engine.Engine)
proxy.LinkSystem = e.LinkSystem()
e, ok := prov.(*engine.Engine)
if ok {
proxy.LinkSystem = e.LinkSystem()
}
}

// RetrievalGraphsync creates a graphsync instance used to serve retrievals.
Expand Down
2 changes: 1 addition & 1 deletion retrievalmarket/server/gsunpaidretrieval.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (g *GraphsyncUnpaidRetrieval) Start(ctx context.Context) error {
g.ctx = ctx
g.validator.ctx = ctx

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

0 comments on commit e669dca

Please sign in to comment.