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
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14908