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:
Maycon Santos
2023-06-01 16:00:44 +02:00
committed by GitHub
parent 47da362a70
commit 3e9b46f8d8
4 changed files with 220 additions and 4 deletions

View File

@@ -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)