Skip to content

Commit

Permalink
Address cosmos#315
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin committed Oct 27, 2020
1 parent bc3532e commit 11c5fed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions relayer/naive-strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"strconv"
"strings"
"time"

retry "github.com/avast/retry-go"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -481,10 +480,12 @@ func relayPacketFromQueryResponse(src, dst *PathEnd, res *ctypes.ResultTx,
}

// if we have decided not to relay this packet, don't add it
block := sh.GetHeader(dst.ChainID)

switch {
case rp.timeout != 0 && sh.GetHeight(dst.ChainID) >= rp.timeout:
case rp.timeout != 0 && block.GetHeight().GetVersionHeight() >= rp.timeout:
timeoutPackets = append(timeoutPackets, rp.timeoutPacket())
case rp.timeoutStamp != 0 && time.Now().UnixNano() >= int64(rp.timeoutStamp):
case rp.timeoutStamp != 0 && block.GetTime().UnixNano() >= int64(rp.timeoutStamp):
timeoutPackets = append(timeoutPackets, rp.timeoutPacket())
case !rp.pass:
rcvPackets = append(rcvPackets, rp)
Expand Down

0 comments on commit 11c5fed

Please sign in to comment.