mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-05 18:23:03 +01:00
net: move state dependent peer services flags
No behavior change. Just an intermediate refactoring. By relocating the peer desirable services flags into the peer manager, we allow the connections acceptance process to handle post-IBD potential stalling scenarios. In the follow-up commit(s), the desirable service flags will be dynamically adjusted to detect post-IBD stalling scenarios (such as a +48-hour inactive node that must prefer full node connections instead of limited peer connections because they cannot provide historical blocks). Additionally, this encapsulation enable us to customize the connections decision-making process based on new user's configurations in the future.
This commit is contained in:
@@ -1005,6 +1005,12 @@ public:
|
||||
/** Handle removal of a peer (clear state) */
|
||||
virtual void FinalizeNode(const CNode& node) = 0;
|
||||
|
||||
/**
|
||||
* Callback to determine whether the given set of service flags are sufficient
|
||||
* for a peer to be "relevant".
|
||||
*/
|
||||
virtual bool HasAllDesirableServiceFlags(ServiceFlags services) const = 0;
|
||||
|
||||
/**
|
||||
* Process protocol messages received from a given node
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user