mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-03 06:37:14 +00:00
p2p: simplify open channel interface (#7133)
A fourth #7075 component patch to simplify the channel creation interface
This commit is contained in:
+1
-1
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user