Skip to content

Commit 446a66c

Browse files
authored
Set RESET packet version number correctly (#735)
1 parent 84fb4d0 commit 446a66c

File tree

1 file changed

+10
-5
lines changed
  • packages/portalnetwork/src/wire/utp/PortalNetworkUtp

1 file changed

+10
-5
lines changed

packages/portalnetwork/src/wire/utp/PortalNetworkUtp/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ export class PortalNetworkUTP {
3333
this.requestManagers = {}
3434
}
3535

36-
closeAllPeerRequests(nodeId: string) {
37-
this.requestManagers[nodeId].closeAllRequests()
36+
closeAllPeerRequests(nodeId: string) {
37+
this.requestManagers[nodeId].closeAllRequests()
3838
}
3939

4040
hasRequests(nodeId: string): boolean {
41-
return this.requestManagers[nodeId] !== undefined && Object.keys(this.requestManagers[nodeId].requestMap).length > 0
41+
return (
42+
this.requestManagers[nodeId] !== undefined &&
43+
Object.keys(this.requestManagers[nodeId].requestMap).length > 0
44+
)
4245
}
4346

4447
openRequests(): number {
@@ -115,7 +118,9 @@ export class PortalNetworkUTP {
115118
contentKeys,
116119
})
117120
await this.requestManagers[enr.nodeId].handleNewRequest(connectionId, newRequest)
118-
this.logger.extend('utpRequest')(`New ${RequestCode[requestCode]} Request with ${enr.nodeId} -- ConnectionId: ${connectionId}`)
121+
this.logger.extend('utpRequest')(
122+
`New ${RequestCode[requestCode]} Request with ${enr.nodeId} -- ConnectionId: ${connectionId}`,
123+
)
119124
this.logger.extend('utpRequest')(`Open Requests: ${this.openRequests()}`)
120125
return newRequest
121126
}
@@ -137,7 +142,7 @@ export class PortalNetworkUTP {
137142
pType: PacketType.ST_RESET,
138143
ackNr: 0,
139144
extension: 0,
140-
version: 0,
145+
version: 1,
141146
timestampMicroseconds: 0,
142147
timestampDifferenceMicroseconds: 0,
143148
seqNr: 0,

0 commit comments

Comments
 (0)