Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix startup with disabled index provider #1604

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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