publicKey NoisePublicKey
}
+ rate struct {
+ underLoadUntil int64
+ limiter ratelimiter.Ratelimiter
+ }
+
peers struct {
- empty AtomicBool // empty reports whether len(keyMap) == 0
- sync.RWMutex // protects keyMap
+ sync.RWMutex // protects keyMap
keyMap map[NoisePublicKey]*Peer
}
indexTable IndexTable
cookieChecker CookieChecker
- rate struct {
- underLoadUntil int64
- limiter ratelimiter.Ratelimiter
- }
-
pool struct {
messageBuffers *WaitPool
inboundElements *WaitPool
// remove from peer map
delete(device.peers.keyMap, key)
- device.peers.empty.Set(len(device.peers.keyMap) == 0)
}
// changeState attempts to change the device state to match want.
}
func (peer *Peer) timersActive() bool {
- return peer.isRunning.Get() && peer.device != nil && peer.device.isUp() && !peer.device.peers.empty.Get()
+ return peer.isRunning.Get() && peer.device != nil && peer.device.isUp()
}
func expiredRetransmitHandshake(peer *Peer) {