p2p: simplify open channel interface (#7133)

A fourth #7075 component patch to simplify the channel creation interface
This commit is contained in:
Sam Kleinman
2021-10-15 18:00:24 +00:00
committed by GitHub
parent cbe6ad6cd5
commit 7143f14a63
13 changed files with 61 additions and 58 deletions
+1 -1
View File
@@ -1098,7 +1098,7 @@ func makeChannelsFromShims(
channels := map[p2p.ChannelID]*p2p.Channel{}
for idx := range chDescs {
chDesc := chDescs[idx]
ch, err := router.OpenChannel(chDesc, chDesc.MessageType, chDesc.RecvBufferCapacity)
ch, err := router.OpenChannel(chDesc)
if err != nil {
panic(fmt.Sprintf("failed to open channel %v: %v", chDesc.ID, err))
}
+1 -2
View File
@@ -30,7 +30,6 @@ import (
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/service"
tmstrings "github.com/tendermint/tendermint/libs/strings"
protop2p "github.com/tendermint/tendermint/proto/tendermint/p2p"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tendermint/version"
@@ -485,7 +484,7 @@ func createPEXReactor(
router *p2p.Router,
) (service.Service, error) {
channel, err := router.OpenChannel(pex.ChannelDescriptor(), &protop2p.PexMessage{}, 128)
channel, err := router.OpenChannel(pex.ChannelDescriptor())
if err != nil {
return nil, err
}