From d2afa051b964261f94fb7cd2e0a54b8fe197eb19 Mon Sep 17 00:00:00 2001 From: Xia Date: Wed, 13 Mar 2019 22:32:24 -0500 Subject: [PATCH] fix --- client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 2f9b302..e5bbc58 100644 --- a/client.go +++ b/client.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "log" - "math" "math/rand" "net" "os" @@ -138,7 +137,8 @@ func handleGossipTCPConnection(node *Node, conn net.Conn) { go sendGossipingMsg(node, "DEAD", round+1, rawMsg) } } else { - fmt.Println("Unknown gossip message format.") + fmt.Print("Unknown gossip message format:") + fmt.Println(gossipRawMsg) } } @@ -155,8 +155,8 @@ func ParseGossipingMessage(gossipRawMsg string) (int, string) { func sendGossipingMsg(node *Node, header string, round int, mesg string) { gossipMesg := "" for { - NumMembers := node.MembersSet.Size() - maxRound := int(10 * math.Log(float64(NumMembers))) // TODO: Change to a constant + // NumMembers := node.MembersSet.Size() + maxRound := 6 //int(10 * math.Log(float64(NumMembers))) // TODO: Change to a constant if round > maxRound { break }