consensus/replay: remove timeout
This commit is contained in:
parent
54b26869d5
commit
ed03cb5c17
|
@ -332,23 +332,13 @@ func (h *Handshaker) replayLastBlock(proxyApp proxy.AppConnConsensus) ([]byte, e
|
||||||
evsw.Start()
|
evsw.Start()
|
||||||
defer evsw.Stop()
|
defer evsw.Stop()
|
||||||
cs.SetEventSwitch(evsw)
|
cs.SetEventSwitch(evsw)
|
||||||
newBlockCh := subscribeToEvent(evsw, "consensus-replay", types.EventStringNewBlock(), 1)
|
|
||||||
|
|
||||||
|
log.Notice("Attempting to replay last block", "height", h.store.Height())
|
||||||
// run through the WAL, commit new block, stop
|
// run through the WAL, commit new block, stop
|
||||||
if _, err := cs.Start(); err != nil {
|
if _, err := cs.Start(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer cs.Stop()
|
cs.Stop()
|
||||||
|
|
||||||
timeout := h.config.GetInt("timeout_handshake")
|
|
||||||
timer := time.NewTimer(time.Duration(timeout) * time.Millisecond)
|
|
||||||
log.Notice("Attempting to replay last block", "height", h.store.Height(), "timeout", timeout)
|
|
||||||
|
|
||||||
select {
|
|
||||||
case <-newBlockCh:
|
|
||||||
case <-timer.C:
|
|
||||||
return nil, ErrReplayLastBlockTimeout
|
|
||||||
}
|
|
||||||
|
|
||||||
h.nBlocks += 1
|
h.nBlocks += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue