Skip to content

Commit

Permalink
bug fix: baker detail, return cycle 0 if we dont' have the cycle info
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Mar 31, 2024
1 parent b628734 commit fd99521
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/KukaiCoreSwift/Clients/TzKTClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public class TzKTClient {
alias = config.name
avatarURL = TzKTClient.avatarURL(forToken: config.address)
fee = config.fee
indexOfCyclePaymentIsFor = (cycleIndexPaymentReceived - (config.payoutDelay - 1))
indexOfCyclePaymentIsFor = (cycleIndexPaymentReceived == 0) ? 0 : (cycleIndexPaymentReceived - (config.payoutDelay - 1))

}
// If the tx came from a known payout address, match it to the baker address and grab the config
Expand All @@ -307,7 +307,7 @@ public class TzKTClient {
alias = config.name
avatarURL = TzKTClient.avatarURL(forToken: config.address)
fee = config.fee
indexOfCyclePaymentIsFor = (cycleIndexPaymentReceived - (config.payoutDelay - 1))
indexOfCyclePaymentIsFor = (cycleIndexPaymentReceived == 0) ? 0 : (cycleIndexPaymentReceived - (config.payoutDelay - 1))
}
}
}
Expand Down

0 comments on commit fd99521

Please sign in to comment.