Bitcoin
|
#include <net.h>
#include <banman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <consensus/consensus.h>
#include <crypto/common.h>
#include <crypto/sha256.h>
#include <primitives/transaction.h>
#include <netbase.h>
#include <scheduler.h>
#include <ui_interface.h>
#include <util/strencodings.h>
#include <fcntl.h>
#include <unordered_map>
#include <math.h>
Classes | |
struct | NodeEvictionCandidate |
class | CNetCleanup |
Macros | |
#define | FEELER_SLEEP_WINDOW 1 |
#define | MSG_NOSIGNAL 0 |
#define | MSG_DONTWAIT 0 |
#define | X(name) stats.name = name |
Enumerations | |
enum | BindFlags { BF_NONE = 0, BF_EXPLICIT = (1U << 0), BF_REPORT_ERROR = (1U << 1), BF_WHITELIST = (1U << 2) } |
Functions | |
std::map< CNetAddr, LocalServiceInfo > mapLocalHost | GUARDED_BY (cs_mapLocalHost) |
unsigned short | GetListenPort () |
bool | GetLocal (CService &addr, const CNetAddr *paddrPeer) |
static std::vector< CAddress > | convertSeed6 (const std::vector< SeedSpec6 > &vSeedsIn) |
Convert the pnSeed6 array into usable address objects. More... | |
CAddress | GetLocalAddress (const CNetAddr *paddrPeer, ServiceFlags nLocalServices) |
static int | GetnScore (const CService &addr) |
bool | IsPeerAddrLocalGood (CNode *pnode) |
void | AdvertiseLocal (CNode *pnode) |
bool | AddLocal (const CService &addr, int nScore) |
bool | AddLocal (const CNetAddr &addr, int nScore) |
void | RemoveLocal (const CService &addr) |
void | SetReachable (enum Network net, bool reachable) |
bool | IsReachable (enum Network net) |
bool | IsReachable (const CNetAddr &addr) |
bool | SeenLocal (const CService &addr) |
bool | IsLocal (const CService &addr) |
static CAddress | GetBindAddress (SOCKET sock) |
static bool | ReverseCompareNodeMinPingTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) |
static bool | ReverseCompareNodeTimeConnected (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) |
static bool | CompareNetGroupKeyed (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) |
static bool | CompareNodeBlockTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) |
static bool | CompareNodeTXTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) |
template<typename T , typename Comparator > | |
static void | EraseLastKElements (std::vector< T > &elements, Comparator comparator, size_t k) |
Sort an array by the specified comparator, then erase the last K elements. More... | |
void | StartMapPort () |
void | InterruptMapPort () |
void | StopMapPort () |
void | Discover () |
int64_t | PoissonNextSend (int64_t now, int average_interval_seconds) |
Variables | |
static constexpr int | DUMP_PEERS_INTERVAL = 15 * 60 |
static const uint64_t | SELECT_TIMEOUT_MILLISECONDS = 50 |
const std::string | NET_MESSAGE_COMMAND_OTHER = "*other*" |
static const uint64_t | RANDOMIZER_ID_NETGROUP = 0x6c0edd8036ef4036ULL |
static const uint64_t | RANDOMIZER_ID_LOCALHOSTNONCE = 0xd93e69e2bbfa5735ULL |
bool | fDiscover = true |
bool | fListen = true |
bool | g_relay_txes = !DEFAULT_BLOCKSONLY |
CCriticalSection | cs_mapLocalHost |
std::string | strSubVersion |
static CNetCleanup | instance_of_cnetcleanup |
#define FEELER_SLEEP_WINDOW 1 |
#define MSG_DONTWAIT 0 |
#define MSG_NOSIGNAL 0 |
#define X | ( | name | ) | stats.name = name |
enum BindFlags |
bool AddLocal | ( | const CService & | addr, |
int | nScore | ||
) |
bool AddLocal | ( | const CNetAddr & | addr, |
int | nScore | ||
) |
void AdvertiseLocal | ( | CNode * | pnode | ) |
|
static |
|
static |
|
static |
Convert the pnSeed6 array into usable address objects.
void Discover | ( | ) |
|
static |
Sort an array by the specified comparator, then erase the last K elements.
unsigned short GetListenPort | ( | ) |
CAddress GetLocalAddress | ( | const CNetAddr * | paddrPeer, |
ServiceFlags | nLocalServices | ||
) |
|
static |
std::map<CNetAddr, LocalServiceInfo> mapLocalHost GUARDED_BY | ( | cs_mapLocalHost | ) |
void InterruptMapPort | ( | ) |
bool IsLocal | ( | const CService & | addr | ) |
check whether a given address is potentially local
bool IsPeerAddrLocalGood | ( | CNode * | pnode | ) |
bool IsReachable | ( | enum Network | net | ) |
bool IsReachable | ( | const CNetAddr & | addr | ) |
Return a timestamp in the future (in microseconds) for exponentially distributed events.
void RemoveLocal | ( | const CService & | addr | ) |
|
static |
|
static |
bool SeenLocal | ( | const CService & | addr | ) |
vote for a local address
void SetReachable | ( | enum Network | net, |
bool | reachable | ||
) |
Mark a network as reachable or unreachable (no automatic connects to it)
void StartMapPort | ( | ) |
void StopMapPort | ( | ) |
CCriticalSection cs_mapLocalHost |
|
static |
bool fDiscover = true |
bool fListen = true |
bool g_relay_txes = !DEFAULT_BLOCKSONLY |
|
static |
const std::string NET_MESSAGE_COMMAND_OTHER = "*other*" |
|
static |
|
static |
|
static |
std::string strSubVersion |
Subversion as sent to the P2P network in version
messages