From 87ba07874c3caf1fddc288a24c2d890eec6449c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 17 May 2022 16:35:33 +0200 Subject: [PATCH] add check for nil relayer --- modules/apps/29-fee/keeper/events.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/apps/29-fee/keeper/events.go b/modules/apps/29-fee/keeper/events.go index 414e4a8b7ce..e5e9b524bf5 100644 --- a/modules/apps/29-fee/keeper/events.go +++ b/modules/apps/29-fee/keeper/events.go @@ -19,9 +19,12 @@ func EmitIncentivizedPacketEvent(ctx sdk.Context, packetID channeltypes.PacketId ) for _, fee := range packetFees.PacketFees { - totalRecvFees.Add(fee.Fee.RecvFee...) - totalAckFees.Add(fee.Fee.AckFee...) - totalTimeoutFees.Add(fee.Fee.TimeoutFee...) + // only emit total fees for packet fees which allow any relayer to relay + if fee.Relayers == nil { + totalRecvFees.Add(fee.Fee.RecvFee...) + totalAckFees.Add(fee.Fee.AckFee...) + totalTimeoutFees.Add(fee.Fee.TimeoutFee...) + } } ctx.EventManager().EmitEvent(