mitigate high traffic - drop faulty peers (#460)
Only allow 1 connection per peer Co-authored-by: Tanguy <tanguy@status.im>
This commit is contained in:
parent
fb0d10b6fd
commit
dffe4bed45
|
@ -25,7 +25,7 @@ declareGauge(libp2p_peers, "total connected peers")
|
|||
|
||||
const
|
||||
MaxConnections* = 50
|
||||
MaxConnectionsPerPeer* = 5
|
||||
MaxConnectionsPerPeer* = 1
|
||||
|
||||
type
|
||||
TooManyConnectionsError* = object of LPError
|
||||
|
|
|
@ -562,6 +562,7 @@ suite "Switch":
|
|||
conns.dec
|
||||
|
||||
switches.add(newStandardSwitch(
|
||||
maxConnsPerPeer = 10,
|
||||
rng = rng))
|
||||
|
||||
switches[0].addConnEventHandler(hook, ConnEventKind.Connected)
|
||||
|
|
Loading…
Reference in New Issue