Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,38 +199,6 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage)

mnp.Relay();

/*
* IT'S SAFE TO REMOVE THIS IN FURTHER VERSIONS
* AFTER MIGRATION TO V12 IS DONE
*/

if (sporkManager.IsSporkActive(SPORK_10_MASTERNODE_PAY_UPDATED_NODES)) return true;
// for migration purposes ping our node on old masternodes network too
std::string retErrorMessage;
std::vector<unsigned char> vchMasterNodeSignature;
int64_t masterNodeSignatureTime = GetAdjustedTime();

std::string strMessage = service.ToString() + std::to_string(masterNodeSignatureTime) + std::to_string(false);

if (!CMessageSigner::SignMessage(strMessage, vchMasterNodeSignature, keyMasternode)) {
errorMessage = "dseep sign message failed.";
return false;
}

if (!CMessageSigner::VerifyMessage(pubKeyMasternode, vchMasterNodeSignature, strMessage, retErrorMessage)) {
errorMessage = "dseep verify message failed: " + retErrorMessage;
return false;
}

LogPrint("masternode", "dseep - relaying from active mn, %s \n", vin.ToString().c_str());
LOCK(cs_vNodes);
for (CNode* pnode : vNodes)
pnode->PushMessage("dseep", vin, vchMasterNodeSignature, masterNodeSignatureTime, false);

/*
* END OF "REMOVE"
*/

return true;
} else {
// Seems like we are trying to send a ping while the Masternode is not registered in the network
Expand Down Expand Up @@ -307,44 +275,6 @@ bool CActiveMasternode::CreateBroadcast(CTxIn vin, CService service, CKey keyCol
return false;
}

/*
* IT'S SAFE TO REMOVE THIS IN FURTHER VERSIONS
* AFTER MIGRATION TO V12 IS DONE
*/

if (sporkManager.IsSporkActive(SPORK_10_MASTERNODE_PAY_UPDATED_NODES)) return true;
// for migration purposes inject our node in old masternodes' list too
std::string retErrorMessage;
std::vector<unsigned char> vchMasterNodeSignature;
int64_t masterNodeSignatureTime = GetAdjustedTime();
std::string donationAddress = "";
int donationPercantage = 0;

std::string vchPubKey(pubKeyCollateralAddress.begin(), pubKeyCollateralAddress.end());
std::string vchPubKey2(pubKeyMasternode.begin(), pubKeyMasternode.end());

std::string strMessage = service.ToString() + std::to_string(masterNodeSignatureTime) + vchPubKey + vchPubKey2 + std::to_string(PROTOCOL_VERSION) + donationAddress + std::to_string(donationPercantage);

if (!CMessageSigner::SignMessage(strMessage, vchMasterNodeSignature, keyCollateralAddress)) {
errorMessage = "dsee sign message failed.";
LogPrintf("CActiveMasternode::Register() - Error: %s\n", errorMessage.c_str());
return false;
}

if (!CMessageSigner::VerifyMessage(pubKeyCollateralAddress, vchMasterNodeSignature, strMessage, retErrorMessage)) {
errorMessage = "dsee verify message failed: " + retErrorMessage;
LogPrintf("CActiveMasternode::Register() - Error: %s\n", errorMessage.c_str());
return false;
}

LOCK(cs_vNodes);
for (CNode* pnode : vNodes)
pnode->PushMessage("dsee", vin, service, vchMasterNodeSignature, masterNodeSignatureTime, pubKeyCollateralAddress, pubKeyMasternode, -1, -1, masterNodeSignatureTime, PROTOCOL_VERSION, donationAddress, donationPercantage);

/*
* END OF "REMOVE"
*/

return true;
}

Expand Down
5 changes: 1 addition & 4 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,7 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int64_t nFe

int CMasternodePayments::GetMinMasternodePaymentsProto()
{
if (sporkManager.IsSporkActive(SPORK_10_MASTERNODE_PAY_UPDATED_NODES))
return ActiveProtocol(); // Allow only updated peers
else
return MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT; // Also allow old peers as long as they are allowed to run
return ActiveProtocol();
}

void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
Expand Down
4 changes: 0 additions & 4 deletions src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ CMasternode::CMasternode() :
nScanningErrorCount = 0;
nLastScanningErrorBlockHeight = 0;
lastTimeChecked = 0;
nLastDsee = 0; // temporary, do not save. Remove after migration to v12
nLastDseep = 0; // temporary, do not save. Remove after migration to v12
}

CMasternode::CMasternode(const CMasternode& other) :
Expand All @@ -102,8 +100,6 @@ CMasternode::CMasternode(const CMasternode& other) :
nScanningErrorCount = other.nScanningErrorCount;
nLastScanningErrorBlockHeight = other.nLastScanningErrorBlockHeight;
lastTimeChecked = 0;
nLastDsee = other.nLastDsee; // temporary, do not save. Remove after migration to v12
nLastDseep = other.nLastDseep; // temporary, do not save. Remove after migration to v12
}

uint256 CMasternode::GetSignatureHash() const
Expand Down
3 changes: 0 additions & 3 deletions src/masternode.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ class CMasternode : public CSignedMessage
int nLastScanningErrorBlockHeight;
CMasternodePing lastPing;

int64_t nLastDsee; // temporary, do not save. Remove after migration to v12
int64_t nLastDseep; // temporary, do not save. Remove after migration to v12

CMasternode();
CMasternode(const CMasternode& other);

Expand Down
Loading