[#PeerManager-GetDesirableServiceFlags] = xref:PeerManager.adoc[PeerManager]::GetDesirableServiceFlags :relfileprefix: ../ :mrdocs: Gets the set of service flags which are "desirable" for a given peer. == Synopsis Declared in `<net_processing.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual xref:ServiceFlags.adoc[ServiceFlags] GetDesirableServiceFlags(xref:ServiceFlags.adoc[ServiceFlags] services) const = 0; ---- == Description These are the flags which are required for a peer to support for them to be "interesting" to us, ie for us to wish to use one of our few outbound connection slots for or for us to wish to prioritize keeping their connection around. Relevant service flags may be peer‐ and state‐specific in that the version of the peer may determine which flags are required (eg in the case of NODE_NETWORK_LIMITED where we seek out NODE_NETWORK peers unless they set NODE_NETWORK_LIMITED and we are out of IBD, in which case NODE_NETWORK_LIMITED suffices). Thus, generally, avoid calling with 'services' == NODE_NONE, unless state‐specific flags must absolutely be avoided. When called with 'services' == NODE_NONE, the returned desirable service flags are guaranteed to not change dependent on state ‐ ie they are suitable for use when describing peers which we know to be desirable, but for which we do not have a confirmed set of service flags. == Return Value The set of service flags considered desirable for such a peer. == Parameters [cols="1,4"] |=== | Name| Description | *services* | The peer's known service flags, or NODE_NONE to request state‐independent flags. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#