Page MenuHomePhabricator

Move additional headers fetching to own function
ClosedPublic

Authored by PiRK on Dec 5 2023, 11:31.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCbba802a752c9: Move additional headers fetching to own function
Summary

Also moves the call to happen directly after validation of a headers message
(rather than mixed in with other state updates for the peer), and removes an
incorrect comment in favor of one that explains why headers sync must continue
from the last header a peer has sent.

This is a backport of core#25454
https://github.com/bitcoin/bitcoin/pull/25454/commits/bf8ea6df75749c27f753b562c4724b3f8d263ad4

Depends on D14907

Note that FetchMoreHeaders requires the cs_main lock to be held because of the use of ActiveChain(). This is needed in the local scope because of the lock splitting in D9591.

Test Plan

With clang and debug:
ninja all check-all