File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/kad-dht/src/routing-table Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -263,13 +263,15 @@ export class RoutingTable extends TypedEventEmitter<RoutingTableEvents> implemen
263
263
const connection = await this . components . connectionManager . openConnection ( oldContact . peerId , options )
264
264
stream = await connection . newStream ( this . protocol , options )
265
265
266
- const pb = pbStream ( stream )
266
+ const pb = pbStream ( stream ) . pb ( Message )
267
267
await pb . write ( {
268
- type : MessageType . PING
269
- } , Message , options )
270
- const response = await pb . read ( Message , options )
268
+ type : MessageType . PING ,
269
+ closer : [ ] ,
270
+ providers : [ ]
271
+ } , options )
272
+ const response = await pb . read ( options )
271
273
272
- await pb . unwrap ( ) . close ( options )
274
+ await pb . unwrap ( ) . unwrap ( ) . close ( options )
273
275
274
276
if ( response . type !== MessageType . PING ) {
275
277
throw new InvalidMessageError ( `Incorrect message type received, expected PING got ${ response . type } ` )
You can’t perform that action at this time.
0 commit comments