Bitcoin
|
#include <protocol.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <arpa/inet.h>
Namespaces | |
NetMsgType | |
Functions | |
static std::atomic< bool > | g_initial_block_download_completed (false) |
static const std::vector< std::string > | allNetMessageTypesVec (allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes)) |
ServiceFlags | GetDesirableServiceFlags (ServiceFlags services) |
void | SetServiceFlagsIBDCache (bool state) |
bool | operator< (const CInv &a, const CInv &b) |
const std::vector< std::string > & | getAllNetMessageTypes () |
Variables | |
const char * | NetMsgType::VERSION ="version" |
const char * | NetMsgType::VERACK ="verack" |
const char * | NetMsgType::ADDR ="addr" |
const char * | NetMsgType::INV ="inv" |
const char * | NetMsgType::GETDATA ="getdata" |
const char * | NetMsgType::MERKLEBLOCK ="merkleblock" |
const char * | NetMsgType::GETBLOCKS ="getblocks" |
const char * | NetMsgType::GETHEADERS ="getheaders" |
const char * | NetMsgType::TX ="tx" |
const char * | NetMsgType::HEADERS ="headers" |
const char * | NetMsgType::BLOCK ="block" |
const char * | NetMsgType::GETADDR ="getaddr" |
const char * | NetMsgType::MEMPOOL ="mempool" |
const char * | NetMsgType::PING ="ping" |
const char * | NetMsgType::PONG ="pong" |
const char * | NetMsgType::NOTFOUND ="notfound" |
const char * | NetMsgType::FILTERLOAD ="filterload" |
const char * | NetMsgType::FILTERADD ="filteradd" |
const char * | NetMsgType::FILTERCLEAR ="filterclear" |
const char * | NetMsgType::REJECT ="reject" |
const char * | NetMsgType::SENDHEADERS ="sendheaders" |
const char * | NetMsgType::FEEFILTER ="feefilter" |
const char * | NetMsgType::SENDCMPCT ="sendcmpct" |
const char * | NetMsgType::CMPCTBLOCK ="cmpctblock" |
const char * | NetMsgType::GETBLOCKTXN ="getblocktxn" |
const char * | NetMsgType::BLOCKTXN ="blocktxn" |
static const std::string | allNetMessageTypes [] |
|
static |
|
static |
const std::vector<std::string>& getAllNetMessageTypes | ( | ) |
ServiceFlags GetDesirableServiceFlags | ( | ServiceFlags | services | ) |
Gets the set of service flags which are "desirable" for a given peer.
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 peerServices == NODE_NONE, unless state-specific flags must absolutely be avoided. When called with peerServices == 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.
If the NODE_NONE return value is changed, contrib/seeds/makeseeds.py should be updated appropriately to filter for the same nodes.
void SetServiceFlagsIBDCache | ( | bool | status | ) |
Set the current IBD status in order to figure out the desirable service flags
|
static |
All known message types. Keep this in the same order as the list of messages above and in protocol.h.