-
Notifications
You must be signed in to change notification settings - Fork 38.7k
net: make m_nodes_mutex non-recursive #32394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1285,23 +1285,23 @@ void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid) | |
| } | ||
| m_connman.ForNode(nodeid, [this](CNode* pfrom) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { | ||
| AssertLockHeld(::cs_main); | ||
| if (lNodesAnnouncingHeaderAndIDs.size() >= 3) { | ||
| // As per BIP152, we only get 3 of our peers to announce | ||
| // blocks using compact encodings. | ||
| m_connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [this](CNode* pnodeStop){ | ||
| MakeAndPushMessage(*pnodeStop, NetMsgType::SENDCMPCT, /*high_bandwidth=*/false, /*version=*/CMPCTBLOCKS_VERSION); | ||
| // save BIP152 bandwidth state: we select peer to be low-bandwidth | ||
| pnodeStop->m_bip152_highbandwidth_to = false; | ||
| return true; | ||
| }); | ||
| lNodesAnnouncingHeaderAndIDs.pop_front(); | ||
vasild marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| MakeAndPushMessage(*pfrom, NetMsgType::SENDCMPCT, /*high_bandwidth=*/true, /*version=*/CMPCTBLOCKS_VERSION); | ||
| // save BIP152 bandwidth state: we select peer to be high-bandwidth | ||
| pfrom->m_bip152_highbandwidth_to = true; | ||
| lNodesAnnouncingHeaderAndIDs.push_back(pfrom->GetId()); | ||
| return true; | ||
| }); | ||
| if (lNodesAnnouncingHeaderAndIDs.size() > 3) { | ||
| // As per BIP152, we only get 3 of our peers to announce | ||
| // blocks using compact encodings. | ||
| m_connman.ForNode(lNodesAnnouncingHeaderAndIDs.front(), [this](CNode* pnodeStop){ | ||
| MakeAndPushMessage(*pnodeStop, NetMsgType::SENDCMPCT, /*high_bandwidth=*/false, /*version=*/CMPCTBLOCKS_VERSION); | ||
| // save BIP152 bandwidth state: we select peer to be low-bandwidth | ||
| pnodeStop->m_bip152_highbandwidth_to = false; | ||
| return true; | ||
| }); | ||
| lNodesAnnouncingHeaderAndIDs.pop_front(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was initially concerned that maybe
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I was a little unclear. I meant that the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that seems to be fine - if the last |
||
| } | ||
| } | ||
|
|
||
| bool PeerManagerImpl::TipMayBeStale() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.