diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 845f64e4492..6b5446fb344 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -1961,9 +1961,6 @@ PeerImp::onMessage(std::shared_ptr const& m) return; } - if (recentTxSets_.size() == 128) - recentTxSets_.pop_front(); - recentTxSets_.push_back(hash); } } @@ -2324,11 +2321,6 @@ PeerImp::addLedger( recentLedgers_.end()) return; - // VFALCO TODO See if a sorted vector would be better. - - if (recentLedgers_.size() == 128) - recentLedgers_.pop_front(); - recentLedgers_.push_back(hash); } diff --git a/src/ripple/overlay/impl/PeerImp.h b/src/ripple/overlay/impl/PeerImp.h index ef30c5c0091..e005fcf846b 100644 --- a/src/ripple/overlay/impl/PeerImp.h +++ b/src/ripple/overlay/impl/PeerImp.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -134,8 +133,9 @@ class PeerImp : public Peer, LedgerIndex maxLedger_ = 0; uint256 closedLedgerHash_; uint256 previousLedgerHash_; - std::deque recentLedgers_; - std::deque recentTxSets_; + + boost::circular_buffer recentLedgers_{128}; + boost::circular_buffer recentTxSets_{128}; boost::optional latency_; boost::optional lastPingSeq_; @@ -495,13 +495,6 @@ class PeerImp : public Peer, // //-------------------------------------------------------------------------- - static error_code - invalid_argument_error() - { - return boost::system::errc::make_error_code( - boost::system::errc::invalid_argument); - } - void onMessageUnknown(std::uint16_t type); @@ -565,9 +558,6 @@ class PeerImp : public Peer, } //-------------------------------------------------------------------------- - void - setLedgerState(); - // lockedRecentLock is passed as a reminder to callers that recentLock_ // must be locked. void