ledger_query: reduce nesting, fix typo
@@ -147,7 +147,10 @@ func findCriticalTransactionToPrefer(ledger *Ledger, oldRoot Transaction) error
ledger.mu.Lock()
defer ledger.mu.Unlock()
- if ledger.snowball.Preferred() == nil {
+ if ledger.snowball.Preferred() != nil {
+ return nil
+ }
+
difficulty := oldRoot.ExpectedDifficulty(byte(sys.MinDifficulty))
var eligible []*Transaction // Find all critical transactions for the current round.
@@ -192,7 +195,6 @@ func findCriticalTransactionToPrefer(ledger *Ledger, oldRoot Transaction) error
initial := NewRound(ledger.round, state.Checksum(), *proposed)
ledger.snowball.Prefer(&initial)
- }
return nil
}
