mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-20 01:06:45 +00:00
limit differences to 5 bytes
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
@@ -510,7 +511,7 @@ func (c *Controller) compareAndSaveNetworkMaps(ctx context.Context, accountId, p
|
||||
return
|
||||
}
|
||||
|
||||
if len(expBytes) == len(legacyBytes) {
|
||||
if len(expBytes) == len(legacyBytes) || math.Abs(float64(len(expBytes)-len(legacyBytes))) > 5 {
|
||||
log.WithContext(ctx).Debugf("network maps are equal for peer %s in account %s (size: %d bytes)", peerId, accountId, len(expBytes))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user