Skip to content

Commit a70677e

Browse files
committed
client: keep networkId as BN in protocol wrappers to avoid number overflow on large network IDs
1 parent 9a9cb4a commit a70677e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/client/lib/net/protocol/ethprotocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class EthProtocol extends Protocol {
150150
*/
151151
decodeStatus(status: any): any {
152152
return {
153-
networkId: bufferToInt(status.networkId),
153+
networkId: new BN(status.networkId),
154154
td: new BN(status.td),
155155
bestHash: status.bestHash,
156156
genesisHash: status.genesisHash,

packages/client/lib/net/protocol/lesprotocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class LesProtocol extends Protocol {
202202
}
203203
}
204204
return {
205-
networkId: bufferToInt(status.networkId),
205+
networkId: new BN(status.networkId),
206206
headTd: new BN(status.headTd),
207207
headHash: status.headHash,
208208
headNum: new BN(status.headNum),

0 commit comments

Comments
 (0)