You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fed2f49
Browse filesBrowse the repository at this point in the historyBrowse files
PeerManager exposed the same check twice: IsBanned() on PeerManager and
PeerIsBanned() on PeerManagerInternal, the latter only forwarding to the
former. Neither name described the check: it does not consult BanMan,
it only reports whether the live Peer has crossed the discouragement
threshold and SendMessages() has not consumed m_should_discourage yet,
and it returns false for peers that are unknown or already finalized.
Both declarations also required cs_main, which the lookup never uses;
it only takes m_peer_mutex and the peer's m_misbehavior_mutex.
Replace both with a single PeerManagerInternal::PeerShouldBeDiscouraged()
without the cs_main requirement, and rename NetSigning's
RemoveBannedNodeStates() to RemoveDiscouragedNodeStates() to match.
Behavior is unchanged, including returning false for missing peers.
Add peer_discouragement assertions covering the flag before and after
crossing the threshold, after SendMessages() consumes it, below the
threshold, and after FinalizeNode().
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments