mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
consensus: fixes #1754
* updateToState exits early if the state isn't new, which happens after * fast syncing. This results in not sending a NewRoundStep message. The mempool * reactor depends on PeerState, which is updated by NewRoundStep * messages. If the peer never sends a NewRoundStep, the mempool reactor * will think they're behind, and never forward transactions. Note this * only happens when `create_empty_blocks = false`, because otherwise * peers will move through the consensus state and send a NewRoundStep * for a new step soon anyways. Simple fix is just to send the * NewRoundStep message during updateToState even if exit early
This commit is contained in:
@ -103,6 +103,7 @@ type PeerState interface {
|
||||
// Send new mempool txs to peer.
|
||||
func (memR *MempoolReactor) broadcastTxRoutine(peer p2p.Peer) {
|
||||
if !memR.config.Broadcast {
|
||||
memR.Logger.Info("Tx broadcasting is disabled")
|
||||
return
|
||||
}
|
||||
|
||||
@ -129,7 +130,8 @@ func (memR *MempoolReactor) broadcastTxRoutine(peer p2p.Peer) {
|
||||
height := memTx.Height()
|
||||
if peerState_i := peer.Get(types.PeerStateKey); peerState_i != nil {
|
||||
peerState := peerState_i.(PeerState)
|
||||
if peerState.GetHeight() < height-1 { // Allow for a lag of 1 block
|
||||
peerHeight := peerState.GetHeight()
|
||||
if peerHeight < height-1 { // Allow for a lag of 1 block
|
||||
time.Sleep(peerCatchupSleepIntervalMS * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user