cswal_light logs own votes; fix tests

This commit is contained in:
Ethan Buchman
2016-03-21 01:24:26 -04:00
parent 16208dc172
commit 922f720cf6
5 changed files with 14 additions and 10 deletions

View File

@ -64,9 +64,12 @@ func NewWAL(file string, light bool) (*WAL, error) {
func (wal *WAL) Save(clm ConsensusLogMessageInterface) {
if wal != nil {
if wal.light {
// in light mode we only write new steps and timeouts (no votes, proposals, block parts)
if _, ok := clm.(msgInfo); ok {
return
// in light mode we only write new steps, timeouts, and our own votes (no proposals, block parts)
if mi, ok := clm.(msgInfo); ok {
_ = mi
if mi.PeerKey != "" {
return
}
}
}
var n int