From ea011db3f2d09e76e6124ee9d54b095f19c519cf Mon Sep 17 00:00:00 2001 From: Justin Tieri <37750742+jtieri@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:36:59 -0500 Subject: [PATCH] Merge PR #769: Use a more meaningful value for the size of the buffered channel --- relayer/strategies.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer/strategies.go b/relayer/strategies.go index b9eea42d1..a26c2e69e 100644 --- a/relayer/strategies.go +++ b/relayer/strategies.go @@ -31,8 +31,6 @@ func StartRelayer(ctx context.Context, log *zap.Logger, src, dst *Chain, filter func relayerMainLoop(ctx context.Context, log *zap.Logger, src, dst *Chain, filter ChannelFilter, maxTxSize, maxMsgLength uint64, errCh chan<- error) { defer close(errCh) - channels := make(chan *ActiveChannel, 10) - // Query the list of channels on the src connection. srcChannels, err := queryChannelsOnConnection(ctx, src) if err != nil { @@ -45,6 +43,8 @@ func relayerMainLoop(ctx context.Context, log *zap.Logger, src, dst *Chain, filt return } + channels := make(chan *ActiveChannel, len(srcChannels)) + // Apply the channel filter rule (i.e. build allowlist, denylist or relay on all channels available), // then filter out only the channels in the OPEN state. srcChannels = applyChannelFilterRule(filter, srcChannels)