Skip to content

Commit

Permalink
devp2p -> RLPx: limit connection refill debug logging to a restarted-…
Browse files Browse the repository at this point in the history
…interval log message to not bloat logging too much
  • Loading branch information
holgerd77 committed Feb 7, 2021
1 parent 1e94410 commit 655d340
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/devp2p/src/rlpx/rlpx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ export class RLPx extends EventEmitter {

_refillConnections() {
if (!this._isAlive()) return
debug(
`refill connections.. (selector ${this._refillIntervalSelectionCounter}) peers: ${
this._peers.size
}, queue size: ${this._peersQueue.length}, open slots: ${this._getOpenSlots()}`
)
if (this._refillIntervalSelectionCounter === 0) {
debug(
`Restart connection refill .. with selector ${this._refillIntervalSelectionCounter} peers: ${
this._peers.size
}, queue size: ${this._peersQueue.length}, open slots: ${this._getOpenSlots()}`
)
}
// Rotating selection counter going in loop from 0..9
this._refillIntervalSelectionCounter = (this._refillIntervalSelectionCounter + 1) % 10

Expand Down

0 comments on commit 655d340

Please sign in to comment.