Skip to content

Commit 4659a77

Browse files
author
evan82
committed
Merge pull request #498 from UdjinM6/v0.12.0.x_dsee_dseep
V0.12.0.x do not add/update v12 MNs from dsee/dseep
2 parents 7d00729 + 4c3f04b commit 4659a77

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/masternodeman.cpp

+14-11
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,15 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
862862
if(count == -1 && pmn->pubkey == pubkey && (pmn->lastPing.sigTime < GetTime() - MASTERNODE_MIN_MNB_SECONDS)){
863863
if(pmn->sigTime < sigTime){ //take the newest entry
864864
LogPrintf("dsee - Got updated entry for %s\n", addr.ToString().c_str());
865-
pmn->pubkey2 = pubkey2;
866-
pmn->sigTime = sigTime;
867-
pmn->sig = vchSig;
868-
pmn->protocolVersion = protocolVersion;
869-
pmn->addr = addr;
870-
//fake ping
871-
pmn->lastPing = CMasternodePing(vin);
865+
if(pmn->protocolVersion == MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1) {
866+
pmn->pubkey2 = pubkey2;
867+
pmn->sigTime = sigTime;
868+
pmn->sig = vchSig;
869+
pmn->protocolVersion = protocolVersion;
870+
pmn->addr = addr;
871+
//fake ping
872+
pmn->lastPing = CMasternodePing(vin);
873+
}
872874
pmn->Check();
873875
if(pmn->IsEnabled()) {
874876
TRY_LOCK(cs_vNodes, lockNodes);
@@ -939,7 +941,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
939941
// use this as a peer
940942
addrman.Add(CAddress(addr), pfrom->addr, 2*60*60);
941943

942-
// add our Masternode
944+
// add Masternode
943945
CMasternode mn = CMasternode();
944946
mn.addr = addr;
945947
mn.vin = vin;
@@ -950,8 +952,9 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
950952
mn.protocolVersion = protocolVersion;
951953
// fake ping
952954
mn.lastPing = CMasternodePing(vin);
953-
Add(mn);
954955
mn.Check(true);
956+
// add v11 masternodes, v12 should be added by mnb only
957+
if(protocolVersion == MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1) Add(mn);
955958
if(mn.IsEnabled()) {
956959
TRY_LOCK(cs_vNodes, lockNodes);
957960
if(!lockNodes) return;
@@ -1013,8 +1016,8 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
10131016
return;
10141017
}
10151018

1016-
// fake ping
1017-
pmn->lastPing = CMasternodePing(vin);
1019+
// fake ping for v11 masternodes, ignore for v12
1020+
if(pmn->protocolVersion == MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1) pmn->lastPing = CMasternodePing(vin);
10181021
pmn->Check();
10191022
if(pmn->IsEnabled()) {
10201023
TRY_LOCK(cs_vNodes, lockNodes);

0 commit comments

Comments
 (0)