diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 249b2d9155..3dbc6e289c 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -1658,15 +1658,13 @@ PeerImp::onMessage (std::shared_ptr const& m) if (m->has_firstseq () && m->has_lastseq()) { + std::lock_guard sl (recentLock_); + minLedger_ = m->firstseq (); maxLedger_ = m->lastseq (); - // VFALCO Is this workaround still needed? - // Work around some servers that report sequences incorrectly - if (minLedger_ == 0) - maxLedger_ = 0; - if (maxLedger_ == 0) - minLedger_ = 0; + if ((maxLedger_ < minLedger_) || (minLedger_ == 0) || (maxLedger_ == 0)) + minLedger_ = maxLedger_ = 0; } if (m->has_ledgerseq() &&