From 5ff975e3b712e487804b20d92eb1a54a33384d9a Mon Sep 17 00:00:00 2001 From: Xia Date: Wed, 13 Mar 2019 22:46:46 -0500 Subject: [PATCH] fix --- .gitignore | 4 +++- client.go | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9e6f569..d90432e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .vscode/ -.vscode/* \ No newline at end of file +.vscode/* +*.log +client diff --git a/client.go b/client.go index e5bbc58..62c01d1 100644 --- a/client.go +++ b/client.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "log" + "math" "math/rand" "net" "os" @@ -155,8 +156,8 @@ func ParseGossipingMessage(gossipRawMsg string) (int, string) { func sendGossipingMsg(node *Node, header string, round int, mesg string) { gossipMesg := "" for { - // NumMembers := node.MembersSet.Size() - maxRound := 6 //int(10 * math.Log(float64(NumMembers))) // TODO: Change to a constant + NumMembers := node.MembersSet.Size() + maxRound := int(4 * math.Log(float64(NumMembers))) // TODO: Change to a constant if round > maxRound { break }