background: Exit early if no votable tickets

This commit is contained in:
jholdstock 2020-10-09 08:43:25 +01:00 committed by David Hill
parent a67de8a024
commit 56a5aa5b1d

View File

@ -245,6 +245,11 @@ func blockConnected() {
continue 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. // Find the oldest block height from confirmed tickets.
oldestHeight := findOldestHeight(dbTickets) oldestHeight := findOldestHeight(dbTickets)
@ -416,6 +421,11 @@ func checkWalletConsistency() {
return 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. // Find the oldest block height from confirmed tickets.
oldestHeight := findOldestHeight(votableTickets) oldestHeight := findOldestHeight(votableTickets)