mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 13:34:26 +00:00
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…
x
Reference in New Issue
Block a user