Skip to content

Commit bd32047

Browse files
committed
client, devp2p -> VM execution: fixed devp2p linting error, use nullish coalescent operator for options.refreshInterval selection in DPT
1 parent 4b2d1cc commit bd32047

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/devp2p/src/dpt/dpt.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class DPT extends EventEmitter {
8080
this._server.on('peers', (peers) => this._onServerPeers(peers))
8181
this._server.on('error', (err) => this.emit('error', err))
8282

83-
const refreshIntervalSubdivided = Math.floor((options.refreshInterval || ms('60s')) / 10)
83+
const refreshIntervalSubdivided = Math.floor((options.refreshInterval ?? ms('60s')) / 10)
8484
this._refreshIntervalId = setInterval(() => this.refresh(), refreshIntervalSubdivided)
8585
}
8686

@@ -178,7 +178,7 @@ export class DPT extends EventEmitter {
178178
for (const peer of peers) {
179179
// Randomly distributed selector based on peer ID
180180
// to decide on subdivided execution
181-
const selector = buffer2int(((peer.id)! as Buffer).slice(0, 1)) % 10
181+
const selector = buffer2int((peer.id! as Buffer).slice(0, 1)) % 10
182182
if (selector === this._refreshIntervalSelectionCounter) {
183183
this._server.findneighbours(peer, randomBytes(64))
184184
}

0 commit comments

Comments
 (0)