@@ -215,13 +215,13 @@ func (dht *IpfsDHT) GetValues(ctx context.Context, key key.Key, nvals int) ([]ro
215
215
// This is what DSHTs (Coral and MainlineDHT) do to store large values in a DHT.
216
216
217
217
// Provide makes this node announce that it can provide a value for the given key
218
- func (dht * IpfsDHT ) Provide (ctx context.Context , key key.Key ) error {
219
- defer log .EventBegin (ctx , "provide" , & key ).Done ()
218
+ func (dht * IpfsDHT ) Provide (ctx context.Context , k key.Key ) error {
219
+ defer log .EventBegin (ctx , "provide" , & k ).Done ()
220
220
221
221
// add self locally
222
- dht .providers .AddProvider (ctx , key , dht .self )
222
+ dht .providers .AddProvider (ctx , k , dht .self )
223
223
224
- peers , err := dht .GetClosestPeers (ctx , key )
224
+ peers , err := dht .GetClosestPeers (ctx , k )
225
225
if err != nil {
226
226
return err
227
227
}
@@ -231,8 +231,8 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key key.Key) error {
231
231
wg .Add (1 )
232
232
go func (p peer.ID ) {
233
233
defer wg .Done ()
234
- log .Debugf ("putProvider(%s, %s)" , key , p )
235
- err := dht .putProvider (ctx , p , string ( key ) )
234
+ log .Debugf ("putProvider(%s, %s)" , k , p )
235
+ err := dht .putProviders (ctx , p , [] key. Key { k } )
236
236
if err != nil {
237
237
log .Debug (err )
238
238
}
0 commit comments