Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xia committed Mar 14, 2019
1 parent 74611c9 commit d2afa05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"log"
"math"
"math/rand"
"net"
"os"
Expand Down Expand Up @@ -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)
}
}

Expand All @@ -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
}
Expand Down

0 comments on commit d2afa05

Please sign in to comment.