Explorar o código

add bool to control update to node

Matthew R. Kasun %!s(int64=3) %!d(string=hai) anos
pai
achega
cfe12e1071
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      mq/publishers.go

+ 5 - 1
mq/publishers.go

@@ -23,7 +23,11 @@ func PublishPeerUpdate(newNode *models.Node, publishToSelf bool) error {
 	}
 	for _, node := range networkNodes {
 
-		if node.IsServer == "yes" || newNode.ID == node.ID { // skip servers and self
+		if node.IsServer == "yes" {
+			continue
+		}
+		if !publishToSelf && newNode.ID == node.ID {
+			//skip self
 			continue
 		}
 		if !publishToSelf && newNode.ID == node.ID {