瀏覽代碼

Allow ValidateLHStaticEntries to check all static host map entries (#141)

* Allow ValidateLHStaticEntries to check all static host map entries

* Cleaner fix for ValidateLHStaticEntries
Chad Harp 5 年之前
父節點
當前提交
efe741ad66
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      lighthouse.go

+ 1 - 4
lighthouse.go

@@ -55,10 +55,7 @@ func NewLightHouse(amLighthouse bool, myIp uint32, ips []uint32, interval int, n
 
 func (lh *LightHouse) ValidateLHStaticEntries() error {
 	for lhIP, _ := range lh.lighthouses {
-		for ip, _ := range lh.staticList {
-			if lhIP == ip {
-				break
-			}
+		if _, ok := lh.staticList[lhIP]; !ok {
 			return fmt.Errorf("Lighthouse %s does not have a static_host_map entry", IntIp(lhIP))
 		}
 	}