mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
Prevent peer updates on flapping status and fix route score logic (#920)
Prevent peer updates if the status is not changing from disconnected to connected and vice versa. Fixed route score calculation, added tests and changed the log message fixed installer /usr/local/bin creation
This commit is contained in:
@@ -146,6 +146,11 @@ func (d *Status) UpdatePeerState(receivedState State) error {
|
||||
|
||||
d.peers[receivedState.PubKey] = peerState
|
||||
|
||||
if receivedState.ConnStatus == StatusConnecting ||
|
||||
(receivedState.ConnStatus == StatusDisconnected && peerState.ConnStatus == StatusConnecting) {
|
||||
return nil
|
||||
}
|
||||
|
||||
ch, found := d.changeNotify[receivedState.PubKey]
|
||||
if found && ch != nil {
|
||||
close(ch)
|
||||
|
||||
Reference in New Issue
Block a user