mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Verify that outbound connections have expected services
This commit is contained in:
parent
3764dec36c
commit
fc83f18153
3 changed files with 15 additions and 0 deletions
|
|
@ -71,6 +71,9 @@ namespace {
|
|||
|
||||
const static std::string NET_MESSAGE_COMMAND_OTHER = "*other*";
|
||||
|
||||
/** Services this node implementation cares about */
|
||||
static const uint64_t nRelevantServices = NODE_NETWORK;
|
||||
|
||||
//
|
||||
// Global state variables
|
||||
//
|
||||
|
|
@ -409,6 +412,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure
|
|||
vNodes.push_back(pnode);
|
||||
}
|
||||
|
||||
pnode->nServicesExpected = addrConnect.nServices & nRelevantServices;
|
||||
pnode->nTimeConnected = GetTime();
|
||||
|
||||
return pnode;
|
||||
|
|
@ -2325,6 +2329,7 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa
|
|||
filterInventoryKnown(50000, 0.000001)
|
||||
{
|
||||
nServices = 0;
|
||||
nServicesExpected = 0;
|
||||
hSocket = hSocketIn;
|
||||
nRecvVersion = INIT_PROTO_VERSION;
|
||||
nLastSend = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue