Fixes issue #22295
(The next thing to do is to make it so that the PartialBlock can be reused, rather than it requesting a full block).
(Fixes #22295)
This doesn't compile:
net_processing.cpp:3540:33: error: calling function 'State' requires holding mutex 'cs_main' exclusively [-Werror,-Wthread-safety-analysis]
CNodeState *nodestate = State(pfrom.GetId());
^
1 error generated.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
I'm not sure this is the direction we want to be moving in. Ideally, our transaction and block relay logic are mostly separate. It'd be good to disentangle any logic/state in our net_processing code that has tight coupling between the two.
The root cause here seems to be that the block download timeout is way too long in most cases, and should be significantly reduced once the node is out of initial sync and at the tip. That timeout isn't specific to compact blocks and could be reduced for all block downloads.