aboutsummaryrefslogtreecommitdiffstats
path: root/device.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--device.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/device.go b/device.go
index 3db3609..99e451e 100644
--- a/device.go
+++ b/device.go
@@ -185,7 +185,7 @@ func (device *Device) IsUnderLoad() bool {
now := time.Now()
underLoad := len(device.queue.handshake) >= UnderLoadQueueSize
if underLoad {
- device.rate.underLoadUntil.Store(now.Add(time.Second))
+ device.rate.underLoadUntil.Store(now.Add(UnderLoadAfterTime))
return true
}
@@ -276,7 +276,7 @@ func NewDevice(tun TUNDevice, logger *Logger) *Device {
device.peers.keyMap = make(map[NoisePublicKey]*Peer)
- // initialize anti-DoS / anti-scanning features
+ // initialize rate limiter
device.rate.limiter.Init()
device.rate.underLoadUntil.Store(time.Time{})