further consolidation

This commit is contained in:
William Banfield
2022-10-20 13:02:46 -04:00
parent 7e5f932402
commit 78fbb5db08
4 changed files with 9 additions and 14 deletions

View File

@@ -452,11 +452,10 @@ func (bcR *Reactor) BroadcastStatusRequest() error {
bcR.Logger.Error("could not convert msg to proto message", "err", err)
return fmt.Errorf("could not convert msg to proto message: %w", err)
}
e := p2p.Envelope{
bcR.Switch.NewBroadcast(p2p.Envelope{
ChannelID: BlocksyncChannel,
Message: wm,
}
bcR.Switch.NewBroadcast(e)
})
return nil
}

View File

@@ -159,11 +159,11 @@ func (evR *Reactor) broadcastEvidenceRoutine(peer p2p.Peer) {
if err != nil {
panic(err)
}
e := p2p.Envelope{
success := peer.Send(p2p.Envelope{
ChannelID: EvidenceChannel,
Message: evp,
}
success := peer.Send(e)
})
if !success {
time.Sleep(peerRetryMessageIntervalMS * time.Millisecond)
continue

View File

@@ -262,15 +262,14 @@ func (memR *Reactor) broadcastTxRoutine(peer p2p.Peer) {
// https://github.com/tendermint/tendermint/issues/5796
if _, ok := memTx.senders.Load(peerID); !ok {
e := p2p.Envelope{
success := peer.Send(p2p.Envelope{
ChannelID: mempool.MempoolChannel,
Message: &protomem.Message{
Sum: &protomem.Message_Txs{
Txs: &protomem.Txs{Txs: [][]byte{memTx.tx}},
},
},
}
success := peer.Send(e)
})
if !success {
time.Sleep(mempool.PeerCatchupSleepIntervalMS * time.Millisecond)
continue

View File

@@ -263,17 +263,14 @@ func (memR *Reactor) broadcastTxRoutine(peer p2p.Peer) {
// NOTE: Transaction batching was disabled due to
// https://github.com/tendermint/tendermint/issues/5796
if !memTx.HasPeer(peerID) {
e := p2p.Envelope{
success := peer.Send(p2p.Envelope{
ChannelID: mempool.MempoolChannel,
Message: &protomem.Message{
Sum: &protomem.Message_Txs{
Txs: &protomem.Txs{Txs: [][]byte{memTx.tx}},
},
},
}
success := peer.Send(e)
})
if !success {
time.Sleep(mempool.PeerCatchupSleepIntervalMS * time.Millisecond)
continue