mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-22 01:11:32 +00:00
more consensus logging
This commit is contained in:
@ -104,3 +104,17 @@ func TestSub2(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPickRandom(t *testing.T) {
|
||||||
|
for idx := 0; idx < 123; idx++ {
|
||||||
|
bA1 := NewBitArray(123)
|
||||||
|
bA1.SetIndex(uint(idx), true)
|
||||||
|
index, ok := bA1.PickRandom()
|
||||||
|
if !ok {
|
||||||
|
t.Fatal("Expected to pick element but got none")
|
||||||
|
}
|
||||||
|
if index != uint(idx) {
|
||||||
|
t.Fatalf("Expected to pick element at %v but got wrong index", idx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -564,7 +564,10 @@ OUTER_LOOP:
|
|||||||
if sleeping == 0 {
|
if sleeping == 0 {
|
||||||
// We sent nothing. Sleep...
|
// We sent nothing. Sleep...
|
||||||
sleeping = 1
|
sleeping = 1
|
||||||
log.Debug("No votes to send, sleeping", "peer", peer)
|
log.Debug("No votes to send, sleeping", "peer", peer,
|
||||||
|
"localPV", rs.Prevotes.BitArray(), "peerPV", prs.Prevotes,
|
||||||
|
"localPC", rs.Precommits.BitArray(), "peerPC", prs.Precommits,
|
||||||
|
"localCM", rs.Commits.BitArray(), "peerCM", prs.Commits)
|
||||||
} else if sleeping == 2 {
|
} else if sleeping == 2 {
|
||||||
// Continued sleep...
|
// Continued sleep...
|
||||||
sleeping = 1
|
sleeping = 1
|
||||||
|
Reference in New Issue
Block a user