diff --git a/src/overlay/OverlayManagerImpl.h b/src/overlay/OverlayManagerImpl.h index 3848b895d1..bf9651bc5c 100644 --- a/src/overlay/OverlayManagerImpl.h +++ b/src/overlay/OverlayManagerImpl.h @@ -103,35 +103,6 @@ class OverlayManagerImpl : public OverlayManager PeersList mInboundPeers; PeersList mOutboundPeers; - - // This gets called once when starting - // and it continues to call itself every FLOOD_DEMAND_PERIOD_MS. - void demand(); - VirtualTimer mDemandTimer; - struct DemandHistory - { - VirtualClock::time_point firstDemanded; - VirtualClock::time_point lastDemanded; - UnorderedMap peers; - bool latencyRecorded{false}; - }; - UnorderedMap mDemandHistoryMap; - - std::queue mPendingDemands; - enum class DemandStatus - { - DEMAND, // Demand - RETRY_LATER, // The timer hasn't expired, and we need to come back to - // this. - DISCARD // We should never demand this txn from this peer. - }; - DemandStatus demandStatus(Hash const& txHash, Peer::pointer) const; - - // After `MAX_RETRY_COUNT` attempts with linear back-off, we assume that - // no one has the transaction. - int const MAX_RETRY_COUNT = 15; - std::chrono::milliseconds retryDelayDemand(int numAttemptsMade) const; - size_t getMaxDemandSize() const; int availableOutboundPendingSlots() const; public: diff --git a/src/overlay/Peer.cpp b/src/overlay/Peer.cpp index 2a2809bcc5..0e17c4dc57 100644 --- a/src/overlay/Peer.cpp +++ b/src/overlay/Peer.cpp @@ -691,10 +691,10 @@ Peer::sendMessage(std::shared_ptr msg, bool log) mOverlayMetrics.mSendSurveyResponseMeter.Mark(); break; case TIME_SLICED_SURVEY_START_COLLECTING: - getOverlayMetrics().mSendStartSurveyCollectingMeter.Mark(); + mOverlayMetrics.mSendStartSurveyCollectingMeter.Mark(); break; case TIME_SLICED_SURVEY_STOP_COLLECTING: - getOverlayMetrics().mSendStopSurveyCollectingMeter.Mark(); + mOverlayMetrics.mSendStopSurveyCollectingMeter.Mark(); break; case SEND_MORE: case SEND_MORE_EXTENDED: @@ -993,15 +993,14 @@ Peer::recvRawMessage(StellarMessage const& stellarMsg) case TIME_SLICED_SURVEY_START_COLLECTING: { - auto t = - getOverlayMetrics().mRecvStartSurveyCollectingTimer.TimeScope(); + auto t = mOverlayMetrics.mRecvStartSurveyCollectingTimer.TimeScope(); recvSurveyStartCollectingMessage(stellarMsg); } break; case TIME_SLICED_SURVEY_STOP_COLLECTING: { - auto t = getOverlayMetrics().mRecvStopSurveyCollectingTimer.TimeScope(); + auto t = mOverlayMetrics.mRecvStopSurveyCollectingTimer.TimeScope(); recvSurveyStopCollectingMessage(stellarMsg); } break; @@ -1200,7 +1199,7 @@ Peer::maybeProcessPingResponse(Hash const& id) CLOG_DEBUG(Overlay, "Latency {}: {} ms", toString(), mLastPing.count()); mOverlayMetrics.mConnectionLatencyTimer.Update(mLastPing); - mApp.getOverlayManager().getSurveyManager().modifyPeerData( + mAppConnector.getOverlayManager().getSurveyManager().modifyPeerData( *this, [&](CollectingPeerData& peerData) { peerData.mLatencyTimer.Update( std::chrono::duration_cast( @@ -1708,16 +1707,18 @@ void Peer::recvSurveyStartCollectingMessage(StellarMessage const& msg) { ZoneScoped; - mApp.getOverlayManager().getSurveyManager().relayStartSurveyCollecting( - msg, shared_from_this()); + mAppConnector.getOverlayManager() + .getSurveyManager() + .relayStartSurveyCollecting(msg, shared_from_this()); } void Peer::recvSurveyStopCollectingMessage(StellarMessage const& msg) { ZoneScoped; - mApp.getOverlayManager().getSurveyManager().relayStopSurveyCollecting( - msg, shared_from_this()); + mAppConnector.getOverlayManager() + .getSurveyManager() + .relayStopSurveyCollecting(msg, shared_from_this()); } void