This commit is contained in:
Jae Kwon 2016-10-28 11:58:09 -07:00
parent fc31b463b1
commit 9a089482dc
1 changed files with 16 additions and 15 deletions

View File

@ -70,7 +70,9 @@ func (wal *WAL) Exists() bool {
// called in newStep and for each pass in receiveRoutine
func (wal *WAL) Save(clm ConsensusLogMessageInterface) {
if wal != nil {
if wal == nil {
return
}
if wal.light {
// in light mode we only write new steps, timeouts, and our own votes (no proposals, block parts)
if mi, ok := clm.(msgInfo); ok {
@ -87,7 +89,6 @@ func (wal *WAL) Save(clm ConsensusLogMessageInterface) {
if err != nil {
PanicQ(Fmt("Error writing msg to consensus wal. Error: %v \n\nMessage: %v", err, clm))
}
}
}
// Must not be called concurrently with a write.