Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
This class handles the p2p message MNAUTH. More...
#include <mnauth.h>
Public Member Functions | |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
Static Public Member Functions | |
static void | PushMNAUTH (CNode *pnode, CConnman &connman) |
static void | ProcessMessage (CNode *pnode, const std::string &strCommand, CDataStream &vRecv, CConnman &connman) |
static void | NotifyMasternodeListChanged (bool undo, const CDeterministicMNList &oldMNList, const CDeterministicMNListDiff &diff) |
Public Attributes | |
uint256 | proRegTxHash |
CBLSSignature | sig |
ADD_SERIALIZE_METHODS | |
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.
Member Function Documentation
◆ NotifyMasternodeListChanged()
|
static |
Definition at line 194 of file mnauth.cpp.
References CNode::cs_mnauth, CNode::fDisconnect, CDeterministicMNStateDiff::Field_pubKeyOperator, g_connman, CNode::GetId(), CDeterministicMNList::GetMN(), base_blob< BITS >::IsNull(), LOCK, LogPrint, BCLog::NET_NETCONN, CDeterministicMNListDiff::removedMns, base_blob< BITS >::ToString(), CDeterministicMNListDiff::updatedMNs, CNode::verifiedProRegTxHash, and CNode::verifiedPubKeyHash.
Referenced by CDSNotificationInterface::NotifyMasternodeListChanged().
◆ ProcessMessage()
|
static |
Definition at line 57 of file mnauth.cpp.
References cs_main, CNode::cs_mnauth, deterministicMNManager, CNode::fDisconnect, CNode::fInbound, CNode::fMasternodeProbe, CConnman::ForEachNode(), gArgs, GetAdjustedTime(), ArgsManager::GetArg(), CNode::GetId(), CMasternodeMetaMan::GetMetaInfo(), ArgsManager::IsArgSet(), CMasternodeSync::IsBlockchainSynced(), base_blob< BITS >::IsNull(), LOCK, LogPrint, CBaseChainParams::MAIN, masternodeSync, Misbehaving(), mmetaman, NetMsgType::MNAUTH, MNAUTH_NODE_VER_VERSION, BCLog::NET_NETCONN, NODE_BLOOM, NODE_NETWORK, CNode::nServices, CNode::nVersion, Params(), PROTOCOL_VERSION, CNode::sentMNAuthChallenge, SerializeHash(), CNode::verifiedProRegTxHash, and CNode::verifiedPubKeyHash.
Referenced by ProcessMessage().
◆ PushMNAUTH()
Definition at line 19 of file mnauth.cpp.
References activeMasternodeInfo, CActiveMasternodeInfo::blsKeyOperator, CActiveMasternodeInfo::blsPubKeyOperator, CNode::cs_mnauth, CNode::fInbound, fMasternodeMode, gArgs, ArgsManager::GetArg(), CNode::GetId(), CNode::GetSendVersion(), ArgsManager::IsArgSet(), base_blob< BITS >::IsNull(), LOCK, LogPrint, CBaseChainParams::MAIN, NetMsgType::MNAUTH, MNAUTH_NODE_VER_VERSION, BCLog::NET_NETCONN, CChainParams::NetworkIDString(), CNode::nVersion, Params(), proRegTxHash, PROTOCOL_VERSION, CActiveMasternodeInfo::proTxHash, CConnman::PushMessage(), CNode::receivedMNAuthChallenge, SerializeHash(), and sig.
Referenced by ProcessMessage().
◆ SerializationOp()
|
inline |
Definition at line 46 of file mnauth.h.
References proRegTxHash, READWRITE, and sig.
Member Data Documentation
◆ ADD_SERIALIZE_METHODS
◆ proRegTxHash
uint256 CMNAuth::proRegTxHash |
Definition at line 39 of file mnauth.h.
Referenced by PushMNAUTH(), and SerializationOp().
◆ sig
CBLSSignature CMNAuth::sig |
Definition at line 40 of file mnauth.h.
Referenced by PushMNAUTH(), and SerializationOp().
The documentation for this class was generated from the following files:
- src/evo/mnauth.h
- src/evo/mnauth.cpp