Explorar el Código

fix old acls migration

abhishek9686 hace 10 meses
padre
commit
604f8f5ef2
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      logic/acls/nodeacls/modify.go

+ 3 - 0
logic/acls/nodeacls/modify.go

@@ -25,6 +25,9 @@ func CreateNodeACL(networkID NetworkID, nodeID NodeID, defaultVal byte) (acls.AC
 	acls.AclMutex.Lock()
 	var newNodeACL = make(acls.ACL)
 	for existingNodeID := range currentNetworkACL {
+		if currentNetworkACL[existingNodeID] == nil {
+			currentNetworkACL[existingNodeID] = make(acls.ACL)
+		}
 		currentNetworkACL[existingNodeID][acls.AclID(nodeID)] = defaultVal // set the old nodes to default value for new node
 		newNodeACL[existingNodeID] = defaultVal                            // set the old nodes in new node ACL to default value
 	}