ci: asan fixes

This commit is contained in:
Byron Hambly 2025-04-17 12:25:41 +02:00
parent 0b1508bf01
commit 979170fd2c
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
4 changed files with 8 additions and 7 deletions

View file

@ -2803,8 +2803,8 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
// If we are already too far ahead of where we want to be on headers, discard
// the received headers. We can still get ahead by up to a single maximum-sized
// headers message here, but never further, so that's fine.
if (m_chainman.m_best_header) {
int64_t headers_ahead = m_chainman.m_best_header->nHeight - WITH_LOCK(::cs_main, return m_chainman.ActiveHeight());
if (WITH_LOCK(::cs_main, return m_chainman.m_best_header)) {
int64_t headers_ahead = WITH_LOCK(::cs_main, return m_chainman.m_best_header->nHeight - m_chainman.ActiveHeight());
bool too_far_ahead = node::fTrimHeaders && (headers_ahead >= node::nHeaderDownloadBuffer);
if (too_far_ahead) {
LOCK(cs_main);