mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-09 21:40:11 +00:00
Merge remote-tracking branch 'origin/master' into wb/pbts-rebase-master
This commit is contained in:
@@ -754,7 +754,7 @@ func getRouterConfig(conf *config.Config, proxyApp proxy.AppConns) p2p.RouterOpt
|
||||
|
||||
if conf.FilterPeers && proxyApp != nil {
|
||||
opts.FilterPeerByID = func(ctx context.Context, id types.NodeID) error {
|
||||
res, err := proxyApp.Query().QuerySync(ctx, abci.RequestQuery{
|
||||
res, err := proxyApp.Query().Query(ctx, abci.RequestQuery{
|
||||
Path: fmt.Sprintf("/p2p/filter/id/%s", id),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -768,7 +768,7 @@ func getRouterConfig(conf *config.Config, proxyApp proxy.AppConns) p2p.RouterOpt
|
||||
}
|
||||
|
||||
opts.FilterPeerByIP = func(ctx context.Context, ip net.IP, port uint16) error {
|
||||
res, err := proxyApp.Query().QuerySync(ctx, abci.RequestQuery{
|
||||
res, err := proxyApp.Query().Query(ctx, abci.RequestQuery{
|
||||
Path: fmt.Sprintf("/p2p/filter/addr/%s", net.JoinHostPort(ip.String(), strconv.Itoa(int(port)))),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -305,6 +305,11 @@ func createPeerManager(
|
||||
nodeID types.NodeID,
|
||||
) (*p2p.PeerManager, closer, error) {
|
||||
|
||||
selfAddr, err := p2p.ParseNodeAddress(nodeID.AddressString(cfg.P2P.ExternalAddress))
|
||||
if err != nil {
|
||||
return nil, func() error { return nil }, fmt.Errorf("couldn't parse ExternalAddress %q: %w", cfg.P2P.ExternalAddress, err)
|
||||
}
|
||||
|
||||
privatePeerIDs := make(map[types.NodeID]struct{})
|
||||
for _, id := range tmstrings.SplitAndTrimEmpty(cfg.P2P.PrivatePeerIDs, ",", " ") {
|
||||
privatePeerIDs[types.NodeID(id)] = struct{}{}
|
||||
@@ -320,6 +325,7 @@ func createPeerManager(
|
||||
}
|
||||
|
||||
options := p2p.PeerManagerOptions{
|
||||
SelfAddress: selfAddr,
|
||||
MaxConnected: maxConns,
|
||||
MaxConnectedUpgrade: 4,
|
||||
MaxPeers: 1000,
|
||||
|
||||
Reference in New Issue
Block a user