Skip to content

Commit

Permalink
fix: ulxly claim filter logic (#348)
Browse files Browse the repository at this point in the history
Signed-off-by: Ji Hwan <jkim@polygon.technology>
  • Loading branch information
jhkimqd authored Aug 19, 2024
1 parent 6290c8a commit 6ca276f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/ulxly/ulxly.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,10 @@ func getDeposits(bridgeServiceDepositsEndpoint string) (globalIndex *big.Int, or
amount = new(big.Int)

intClaimIndex, _ := strconv.Atoi(*ulxlyInputArgs.ClaimIndex) // Convert deposit_cnt to int
destinationNetwork, _ := strconv.Atoi(*ulxlyInputArgs.ClaimDestinationNetwork)
for index, deposit := range bridgeDeposit.Deposit {
intDepositCnt, _ := strconv.Atoi(deposit.DepositCnt) // Convert deposit_cnt to int
if intDepositCnt == intClaimIndex { // deposit_cnt must match the user's input value
intDepositCnt, _ := strconv.Atoi(deposit.DepositCnt) // Convert deposit_cnt to int
if intDepositCnt == intClaimIndex && destinationNetwork == deposit.DestNet { // deposit_cnt must match the user's input value
if !bridgeDeposit.Deposit[index].ReadyForClaim {
log.Error().Msg("The claim transaction is not yet ready to be claimed. Try again in a few blocks.")
return nil, common.HexToAddress("0x0"), nil, nil, errors.New("the claim transaction is not yet ready to be claimed, try again in a few blocks")
Expand Down

0 comments on commit 6ca276f

Please sign in to comment.