diff --git a/background/background.go b/background/background.go index 2c55a0c..c1f36a3 100644 --- a/background/background.go +++ b/background/background.go @@ -245,6 +245,11 @@ func blockConnected() { continue } + // If the database has no votable tickets, there is nothing more to do + if len(dbTickets) == 0 { + break + } + // Find the oldest block height from confirmed tickets. oldestHeight := findOldestHeight(dbTickets) @@ -416,6 +421,11 @@ func checkWalletConsistency() { return } + // If the database has no votable tickets, there is nothing more to do + if len(votableTickets) == 0 { + return + } + // Find the oldest block height from confirmed tickets. oldestHeight := findOldestHeight(votableTickets)