Skip to content

Commit

Permalink
Pre-filter flush channels (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin authored Mar 27, 2023
1 parent 88acf21 commit 048dfa4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions relayer/processor/path_processor_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1045,12 +1045,26 @@ func (pp *PathProcessor) flush(ctx context.Context) {
if !open {
continue
}
if !pp.pathEnd1.info.ShouldRelayChannel(ChainChannelKey{
ChainID: pp.pathEnd1.info.ChainID,
CounterpartyChainID: pp.pathEnd2.info.ChainID,
ChannelKey: k,
}) {
continue
}
eg.Go(queryPacketCommitments(ctx, pp.pathEnd1, k, commitments1, &commitments1Mu))
}
for k, open := range pp.pathEnd2.channelStateCache {
if !open {
continue
}
if !pp.pathEnd2.info.ShouldRelayChannel(ChainChannelKey{
ChainID: pp.pathEnd2.info.ChainID,
CounterpartyChainID: pp.pathEnd1.info.ChainID,
ChannelKey: k,
}) {
continue
}
eg.Go(queryPacketCommitments(ctx, pp.pathEnd2, k, commitments2, &commitments2Mu))
}

Expand Down

0 comments on commit 048dfa4

Please sign in to comment.