func determineQuorum(initPeerCountFlag int, router *weave.NetworkRouter) uint {
	if initPeerCountFlag > 0 {
		return uint(initPeerCountFlag/2 + 1)
	}

	peers := router.ConnectionMaker.Targets(true)

	// Guess a suitable quorum size based on the list of peer
	// addresses.  The peer list might or might not contain an
	// address for this peer, so the conservative assumption is
	// that it doesn't.  The list might contain multiple addresses
	// that resolve to the same peer, in which case the quorum
	// might be larger than it needs to be.  But the user can
	// specify it explicitly if that becomes a problem.
	clusterSize := uint(len(peers) + 1)
	quorum := clusterSize/2 + 1
	Log.Println("Assuming quorum size of", quorum)
	return quorum
}
// Pick a quorum size based on the number of peer addresses.
Pick a quorum size based on the number of peer addresses.
// Pick a quorum size based on the number of peer addresses .
func determineQuorum(initPeerCountFlag int, router *weave.NetworkRouter) uint {
	if initPeerCountFlag > 0 {
		return uint(initPeerCountFlag/2 + 1)
	}
	peers := router.ConnectionMaker.Targets(true)
	clusterSize := uint(len(peers) + 1)
	quorum := clusterSize/2 + 1
	Log.Println("Assuming quorum size of", quorum)
	return quorum
}
func determineQuorum ( initPeerCountFlag int , router * weave . NetworkRouter ) uint { if initPeerCountFlag > 0 { return uint ( initPeerCountFlag / 2 + 1 ) } peers := router . ConnectionMaker . Targets ( true ) clusterSize := uint ( len ( peers ) + 1 ) quorum := clusterSize / 2 + 1 Log . Println ( " " , quorum ) return quorum }
Pick a quorum size based on the number of peer addresses.
Pick a quorum size based on the number of peer addresses .
// Guess a suitable quorum size based on the list of peer // addresses.  The peer list might or might not contain an // address for this peer, so the conservative assumption is // that it doesn't.  The list might contain multiple addresses // that resolve to the same peer, in which case the quorum // might be larger than it needs to be.  But the user can // specify it explicitly if that becomes a problem.