Skip to content

Commit f4f57fb

Browse files
committed
Pass fMasternode variable in VERSION so that the other end knows about it
1 parent 0fa2e14 commit f4f57fb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/masternode/masternode-utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void CMasternodeUtils::ProcessMasternodeConnections(CConnman& connman)
3939
}
4040

4141
connman.ForEachNode(CConnman::AllNodes, [&](CNode* pnode) {
42-
if (pnode->fMasternode && !connman.IsMasternodeQuorumNode(pnode)) {
42+
if (!pnode->fInbound && pnode->fMasternode && !connman.IsMasternodeQuorumNode(pnode)) {
4343
#ifdef ENABLE_WALLET
4444
bool fFound = false;
4545
for (const auto& dmn : vecDmns) {

src/net_processing.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)
321321
}
322322

323323
connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe,
324-
nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes, mnauthChallenge));
324+
nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes, mnauthChallenge, pnode->fMasternode));
325325

326326
if (fLogIPs) {
327327
LogPrint(BCLog::NET, "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid);
@@ -1870,6 +1870,13 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
18701870
LOCK(pfrom->cs_mnauth);
18711871
vRecv >> pfrom->receivedMNAuthChallenge;
18721872
}
1873+
if (!vRecv.empty()) {
1874+
bool fOtherMasternode = false;
1875+
vRecv >> fOtherMasternode;
1876+
if (pfrom->fInbound) {
1877+
pfrom->fMasternode = fOtherMasternode;
1878+
}
1879+
}
18731880
// Disconnect if we connected to ourself
18741881
if (pfrom->fInbound && !connman->CheckIncomingNonce(nNonce))
18751882
{

0 commit comments

Comments
 (0)