Update peerState's vote bitarrays when needed.

This commit is contained in:
Jae Kwon
2014-10-26 00:09:22 -07:00
parent c3fc1a39ea
commit 3df3107479
3 changed files with 105 additions and 58 deletions

View File

@ -54,6 +54,10 @@ func (bA BitArray) WriteTo(w io.Writer) (n int64, err error) {
return
}
func (bA BitArray) IsZero() bool {
return bA.bits == 0
}
// NOTE: behavior is undefined if i >= bA.bits
func (bA BitArray) GetIndex(i uint) bool {
if i >= bA.bits {