Skip to content

Commit

Permalink
Set RESET packet version number correctly (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 authored Feb 17, 2025
1 parent 84fb4d0 commit 446a66c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/portalnetwork/src/wire/utp/PortalNetworkUtp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ export class PortalNetworkUTP {
this.requestManagers = {}
}

closeAllPeerRequests(nodeId: string) {
this.requestManagers[nodeId].closeAllRequests()
closeAllPeerRequests(nodeId: string) {
this.requestManagers[nodeId].closeAllRequests()
}

hasRequests(nodeId: string): boolean {
return this.requestManagers[nodeId] !== undefined && Object.keys(this.requestManagers[nodeId].requestMap).length > 0
return (
this.requestManagers[nodeId] !== undefined &&
Object.keys(this.requestManagers[nodeId].requestMap).length > 0
)
}

openRequests(): number {
Expand Down Expand Up @@ -115,7 +118,9 @@ export class PortalNetworkUTP {
contentKeys,
})
await this.requestManagers[enr.nodeId].handleNewRequest(connectionId, newRequest)
this.logger.extend('utpRequest')(`New ${RequestCode[requestCode]} Request with ${enr.nodeId} -- ConnectionId: ${connectionId}`)
this.logger.extend('utpRequest')(
`New ${RequestCode[requestCode]} Request with ${enr.nodeId} -- ConnectionId: ${connectionId}`,
)
this.logger.extend('utpRequest')(`Open Requests: ${this.openRequests()}`)
return newRequest
}
Expand All @@ -137,7 +142,7 @@ export class PortalNetworkUTP {
pType: PacketType.ST_RESET,
ackNr: 0,
extension: 0,
version: 0,
version: 1,
timestampMicroseconds: 0,
timestampDifferenceMicroseconds: 0,
seqNr: 0,
Expand Down

0 comments on commit 446a66c

Please sign in to comment.