iface delta

This commit is contained in:
0xdcarns
2022-01-30 20:31:11 -05:00
parent be5fdc7fc6
commit 4740551473
6 changed files with 15 additions and 11 deletions

View File

@@ -254,10 +254,14 @@ func CreateNode(node *models.Node) error {
return err
}
// ShouldPeersUpdate - takes old node and sees if certain fields changing would trigger a peer update
func ShouldPeersUpdate(currentNode *models.Node, newNode *models.Node) bool {
// IfaceDelta - is there interface changes
func IfaceDelta(currentNode *models.Node, newNode *models.Node) bool {
SetNodeDefaults(newNode)
// single comparison statements
if currentNode.IsServer != "yes" {
return false
}
if newNode.Endpoint != currentNode.Endpoint ||
newNode.LocalAddress != currentNode.LocalAddress ||
newNode.PublicKey != currentNode.PublicKey ||