Commit 4483fe79 authored by masala's avatar masala

add hack to workaround bootstrap at epoch boundary

parent ec8cab68
......@@ -141,7 +141,12 @@ func (s *state) fsm() <-chan time.Time {
s.Lock()
var sleep time.Duration
epoch, elapsed, nextEpoch := epochtime.Now()
s.log.Debugf("Current epoch %d", epoch)
s.log.Debugf("Current epoch %d, remaining time: %d", epoch, nextEpoch)
if nextEpoch < 3 * time.Minute { // bootstrap time
s.log.Debugf("Too close to epoch boundary, sleeping for %d", nextEpoch)
<-time.After(nextEpoch)
s.votingEpoch = epoch + 1
}
switch s.state {
case stateBootstrap:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment