PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CMNAuth Class Reference

This class handles the p2p message MNAUTH. More...

#include <mnauth.h>

Collaboration diagram for CMNAuth:
[legend]

Public Member Functions

 SERIALIZE_METHODS (CMNAuth, obj)
 

Static Public Member Functions

static void PushMNAUTH (CNode *pnode, CConnman &connman)
 
static bool ProcessMessage (CNode *pnode, const std::string &strCommand, CDataStream &vRecv, CConnman &connman, CValidationState &state)
 
static void NotifyMasternodeListChanged (bool undo, const CDeterministicMNList &oldMNList, const CDeterministicMNListDiff &diff)
 

Public Attributes

uint256 proRegTxHash
 
CBLSSignature sig
 

Detailed Description

This class handles the p2p message MNAUTH.

MNAUTH is sent directly after VERACK and authenticates the sender as a masternode. It is only sent when the sender is actually a masternode.

MNAUTH signs a challenge that was previously sent via VERSION. The challenge is signed differently depending on the connection being an inbound or outbound connection, which avoids MITM of this form: node1 <- Eve -> node2 while still allowing: node1 -> Eve -> node2

This is fine as we only use this mechanism for DoS protection. It allows us to keep masternode connections open for a very long time without evicting the connections when inbound connection limits are hit (non-MNs will then be evicted).

If we ever want to add transfer of sensitive data, THIS AUTHENTICATION MECHANISM IS NOT ENOUGH!! We'd need to implement proper encryption for these connections first.

Definition at line 36 of file mnauth.h.

Member Function Documentation

◆ NotifyMasternodeListChanged()

void CMNAuth::NotifyMasternodeListChanged ( bool  undo,
const CDeterministicMNList oldMNList,
const CDeterministicMNListDiff diff 
)
static

Definition at line 198 of file mnauth.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessMessage()

bool CMNAuth::ProcessMessage ( CNode pnode,
const std::string &  strCommand,
CDataStream vRecv,
CConnman connman,
CValidationState state 
)
static

Definition at line 60 of file mnauth.cpp.

Here is the call graph for this function:

◆ PushMNAUTH()

void CMNAuth::PushMNAUTH ( CNode pnode,
CConnman connman 
)
static

Definition at line 21 of file mnauth.cpp.

Here is the call graph for this function:

◆ SERIALIZE_METHODS()

CMNAuth::SERIALIZE_METHODS ( CMNAuth  ,
obj   
)
inline

Definition at line 41 of file mnauth.h.

Member Data Documentation

◆ proRegTxHash

uint256 CMNAuth::proRegTxHash

Definition at line 39 of file mnauth.h.

◆ sig

CBLSSignature CMNAuth::sig

Definition at line 40 of file mnauth.h.


The documentation for this class was generated from the following files: