File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/kad-dht/src/routing-table Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -269,20 +269,21 @@ export class RoutingTable extends TypedEventEmitter<RoutingTableEvents> implemen
269
269
} , Message , options )
270
270
const response = await pb . read ( Message , options )
271
271
272
- await pb . unwrap ( ) . close ( )
272
+ await pb . unwrap ( ) . close ( options )
273
273
274
274
if ( response . type !== MessageType . PING ) {
275
275
throw new InvalidMessageError ( `Incorrect message type received, expected PING got ${ response . type } ` )
276
276
}
277
277
278
+ this . log ( 'old contact %p ping ok' , oldContact . peerId )
278
279
return true
279
280
} catch ( err : any ) {
280
- if ( this . running && this . kb != null ) {
281
+ if ( this . running ) {
281
282
// only evict peers if we are still running, otherwise we evict
282
283
// when dialing is cancelled due to shutdown in progress
283
- this . log . error ( 'could not ping peer %p' , oldContact . peerId , err )
284
+ this . log . error ( 'could not ping peer %p - %e ' , oldContact . peerId , err )
284
285
this . log ( 'evicting old contact after ping failed %p' , oldContact . peerId )
285
- this . kb . remove ( oldContact . kadId )
286
+ this . kb ? .remove ( oldContact . kadId )
286
287
}
287
288
288
289
stream ?. abort ( err )
You can’t perform that action at this time.
0 commit comments