Skip to content

Commit

Permalink
fix: overflow crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Syn-McJ committed Apr 23, 2024
1 parent d77a240 commit 7539073
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ final class SyncingAlertContentView: UIView {
let atTheEndOfSyncBlocksAndSyncingMasternodeList = chain.lastSyncBlockHeight >= chain.estimatedBlockHeight - 6 && chainManager.masternodeManager
.masternodeListRetrievalQueueCount > 0 && chainManager.syncPhase == .synced
if atTheEndOfInitialTerminalBlocksAndSyncingMasternodeList || atTheEndOfSyncBlocksAndSyncingMasternodeList {
let remaining = max(0, chainManager.masternodeManager.masternodeListRetrievalQueueMaxAmount - chainManager.masternodeManager.masternodeListRetrievalQueueCount)
var remaining: UInt = 0

if chainManager.masternodeManager.masternodeListRetrievalQueueCount > chainManager.masternodeManager.masternodeListRetrievalQueueMaxAmount {
remaining = 0
} else {
remaining = chainManager.masternodeManager.masternodeListRetrievalQueueMaxAmount - chainManager.masternodeManager.masternodeListRetrievalQueueCount
}

subtitleLabel.text = String(format: NSLocalizedString("masternode list #%d of %d", comment: ""), remaining, chainManager.masternodeManager.masternodeListRetrievalQueueMaxAmount)
} else {
if chainManager.syncPhase == .initialTerminalBlocks {
Expand Down

0 comments on commit 7539073

Please sign in to comment.