As described in #32179, pindexLastCommonBlock
is updated later than necessary
in master.
In case of a linear chain with no forks, it can be moved forward at the beginning of
FindNextBlocksToDownload
, so that the updated value can be used to better estimate nWindowEnd
.
This helps the node to request all blocks from peers within the correct 1024-block-window and avoids peers being incorrectly marked as stallers.
The second commit removes a special case introduced in 49d569cb1fdd62a9da8dff51dccaf4680fe3d0eb which is not necessary, because the more general logic also covers this case.
I also changed p2p_ibd_stalling.py
to cover the situation after a resolved situation, making sure that no additional peers are marked for stalling.
Fixes #32179