Compute quorum based on the dynamic number of target peers

This commit is contained in:
Bryan Boreham committed 2016-03-24 12:06:59 +00:00
1 parent 7776e48a62
commit 2b617633ae
5 files changed
+34 -24

No files matched your search

+2 -1
View File
@@ -144,7 +144,8 @@ func makeAllocator(name string, cidrStr string, quorum uint) (*Allocator, addres
OurUID: mesh.PeerUID(rand.Int63()),
OurNickname: "nick-" + name,
Universe: cidr.Range(),
Quorum: quorum,
IsObserver: quorum == 0,
Quorum: func() uint { return quorum },
Db: new(mockDB),
IsKnownPeer: func(mesh.PeerName) bool { return true },
}), cidr