Merge 8efa73e7ce into merged_master (Bitcoin PR bitcoin/bitcoin#25557)

This commit is contained in:
James Dorfman 2024-10-16 06:40:15 +00:00
commit 3e5580265d
2 changed files with 4 additions and 4 deletions

View file

@ -358,7 +358,7 @@ struct Peer {
std::deque<CInv> m_getdata_requests GUARDED_BY(m_getdata_requests_mutex);
/** Time of the last getheaders message to this peer */
std::atomic<NodeClock::time_point> m_last_getheaders_timestamp{NodeSeconds{}};
NodeClock::time_point m_last_getheaders_timestamp{};
Peer(NodeId id)
: m_id{id}
@ -2280,7 +2280,7 @@ bool PeerManagerImpl::MaybeSendGetHeaders(CNode& pfrom, const CBlockLocator& loc
// Only allow a new getheaders message to go out if we don't have a recent
// one already in-flight
if (current_time - peer.m_last_getheaders_timestamp.load() > HEADERS_RESPONSE_TIME) {
if (current_time - peer.m_last_getheaders_timestamp > HEADERS_RESPONSE_TIME) {
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETHEADERS, locator, uint256()));
peer.m_last_getheaders_timestamp = current_time;
return true;
@ -4041,7 +4041,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// Assume that this is in response to any outstanding getheaders
// request we may have sent, and clear out the time of our last request
peer->m_last_getheaders_timestamp.store(NodeSeconds{});
peer->m_last_getheaders_timestamp = {};
std::vector<CBlockHeader> headers;