Skip to content

Commit

Permalink
fix: check Graphsync retrievals too (#56)
Browse files Browse the repository at this point in the history
When the storage provider does not advertise HTTP retrieval, but
advertises Grapsync retrievals, then let's perform the retrieval check.

This was my original intention when I implemented IPNI querying.

Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored Mar 8, 2024
1 parent e008f78 commit ecba43d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export default class Spark {
const { indexerResult, provider } = await queryTheIndex(retrieval.cid)
stats.indexerResult = indexerResult

if (indexerResult !== 'OK') return
const providerFound = indexerResult === 'OK' || indexerResult === 'HTTP_NOT_ADVERTISED'
if (!providerFound) return

stats.protocol = provider.protocol
stats.providerAddress = provider.address
Expand Down

0 comments on commit ecba43d

Please sign in to comment.