From 94fa8cbc788215733a773164010e6f515428e80a Mon Sep 17 00:00:00 2001
From: Benjamin Wenger <ben@elixxir.ioo>
Date: Wed, 20 Oct 2021 15:40:46 -0700
Subject: [PATCH] fixed message hander for change to preimages being a map

---
 network/message/handler.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/network/message/handler.go b/network/message/handler.go
index 1931dc84c..a9a387b2c 100644
--- a/network/message/handler.go
+++ b/network/message/handler.go
@@ -58,9 +58,11 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle, edge *edge
 	preimagelist, exist := edge.Get(identity.Source)
 	if exist{
 		//if it exists, check against all in the list
-		for i:=0;i<len(preimagelist)&&!forMe;i++{
-			forMe = fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(),
-				ecrMsg.GetContents(), preimagelist[i].Data)
+		for key := range preimagelist{
+			if forMe = fingerprint2.CheckIdentityFP(ecrMsg.GetIdentityFP(),
+				ecrMsg.GetContents(), preimagelist[key].Data); forMe{
+				break
+			}
 		}
 	}else{
 		//if it doesnt exist, check against the default fingerprint for the identity
-- 
GitLab