From e4919220588bb58239095ba8503c12d64281f6e2 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 6 Aug 2012 03:06:16 -0700 Subject: [PATCH] Simplify. --- src/NetworkOPs.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 647e195fa3..c6be046c41 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -455,27 +455,16 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector& peerLis // 3) Is there a network ledger we'd like to switch to? If so, do we have it? bool switchLedgers = false; - std::list deadLedgers = theApp->getValidations().getDeadLedgers(); for (boost::unordered_map::iterator it = ledgers.begin(), end = ledgers.end(); it != end; ++it) { Log(lsTRACE) << "L: " << it->first.GetHex() << " t=" << it->second.trustedValidations << ", n=" << it->second.nodesUsing; - if (it->second > bestVC) + if ((it->second > bestVC) && !theApp->getValidations().isDeadLedger(it->first)) { - bool dead = false; - for (std::list::iterator dit = deadLedgers.begin(), end = deadLedgers.end(); dit != end; ++dit) - if (*dit == it->first) - { - dead = true; - break; - } - if (!dead) - { - bestVC = it->second; - closedLedger = it->first; - switchLedgers = true; - } + bestVC = it->second; + closedLedger = it->first; + switchLedgers = true; } }