Skip to content

Commit

Permalink
Warn on unsipported dhstore Get (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Feb 6, 2024
1 parent 245cb70 commit 42912b6
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions store/dhstore/dhstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@ func New(dhstoreURL string, options ...Option) (*dhStore, error) {
}

func (s *dhStore) Get(m multihash.Multihash) ([]indexer.Value, bool, error) {
// Return not found for any double-hashed or invalid multihash.
dm, err := multihash.Decode(m)
if err != nil {
log.Warnw("Get ignored bad multihash", "err", err)
return nil, false, nil
}
if dm.Code == multihash.DBL_SHA2_256 {
return nil, false, nil
}

// Log warning and return not found.
log.Warnw("Get ignored, request must be sent to dstore ")
return nil, false, nil
}

Expand Down

0 comments on commit 42912b6

Please sign in to comment.