mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
asan: lock cs_main for calls to chainman
This commit is contained in:
parent
ffa0c01a17
commit
c794f76ea8
4 changed files with 13 additions and 7 deletions
|
|
@ -2766,7 +2766,7 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
|
|||
// 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 - m_chainman.ActiveHeight();
|
||||
int64_t headers_ahead = m_chainman.m_best_header->nHeight - WITH_LOCK(::cs_main, return m_chainman.ActiveHeight());
|
||||
bool too_far_ahead = node::fTrimHeaders && (headers_ahead >= node::nHeaderDownloadBuffer);
|
||||
if (too_far_ahead) {
|
||||
LOCK(cs_main);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue