Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.h
Show First 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | |||||
* peerServices == NODE_NONE, the returned desirable service flags are | * peerServices == NODE_NONE, the returned desirable service flags are | ||||
* guaranteed to not change dependant on state - ie they are suitable for | * guaranteed to not change dependant on state - ie they are suitable for | ||||
* use when describing peers which we know to be desirable, but for which | * use when describing peers which we know to be desirable, but for which | ||||
* we do not have a confirmed set of service flags. | * we do not have a confirmed set of service flags. | ||||
* | * | ||||
* If the NODE_NONE return value is changed, contrib/seeds/makeseeds.py | * If the NODE_NONE return value is changed, contrib/seeds/makeseeds.py | ||||
* should be updated appropriately to filter for the same nodes. | * should be updated appropriately to filter for the same nodes. | ||||
*/ | */ | ||||
static ServiceFlags GetDesirableServiceFlags(ServiceFlags services) { | ServiceFlags GetDesirableServiceFlags(ServiceFlags services); | ||||
return ServiceFlags(NODE_NETWORK); | |||||
} | /** | ||||
* Set the current IBD status in order to figure out the desirable service | |||||
* flags | |||||
*/ | |||||
void SetServiceFlagsIBDCache(bool status); | |||||
/** | /** | ||||
* A shortcut for (services & GetDesirableServiceFlags(services)) | * A shortcut for (services & GetDesirableServiceFlags(services)) | ||||
* == GetDesirableServiceFlags(services), ie determines whether the given | * == GetDesirableServiceFlags(services), ie determines whether the given | ||||
* set of service flags are sufficient for a peer to be "relevant". | * set of service flags are sufficient for a peer to be "relevant". | ||||
*/ | */ | ||||
static inline bool HasAllDesirableServiceFlags(ServiceFlags services) { | static inline bool HasAllDesirableServiceFlags(ServiceFlags services) { | ||||
return !(GetDesirableServiceFlags(services) & (~services)); | return !(GetDesirableServiceFlags(services) & (~services)); | ||||
} | } | ||||
/** | /** | ||||
* Checks if a peer with the given service flags may be capable of having a | * Checks if a peer with the given service flags may be capable of having a | ||||
* robust address-storage DB. Currently an alias for checking NODE_NETWORK. | * robust address-storage DB. | ||||
*/ | */ | ||||
static inline bool MayHaveUsefulAddressDB(ServiceFlags services) { | static inline bool MayHaveUsefulAddressDB(ServiceFlags services) { | ||||
return services & NODE_NETWORK; | return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED); | ||||
} | } | ||||
/** | /** | ||||
* A CService with information about it as peer. | * A CService with information about it as peer. | ||||
*/ | */ | ||||
class CAddress : public CService { | class CAddress : public CService { | ||||
public: | public: | ||||
CAddress(); | CAddress(); | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |