The only case of a recursive lock was a nested ForNode()
call to trim
the size of lNodesAnnouncingHeaderAndIDs
to <= 3
. This need not be
nested, so take it out.
Before:
0fornode(newnode)
1 if (size >= 3)
2 fornode(front) handle removal of front
3 pop front
4 push back newnode
After:
0fornode(newnode)
1 push back newnode
2if (size > 3)
3 fornode(front) handle removal of front
4 pop front
lNodesAnnouncingHeaderAndIDs
is protected by cs_main
which is locked
during the entire operation.
Partially resolves: #19303
This PR included #32326 (first 3 commits in this PR). That PR was merged first, so the size of this was reduced.