From 394bf89532a026860cec2306bc56ea873acbb665 Mon Sep 17 00:00:00 2001 From: Harald Krekeler Date: Sun, 30 Jan 2022 17:57:36 +0100 Subject: [PATCH] Remone SPORK_6_NEW_SIGS SPORK_6_NEW_SIGS was only activated in testnet3. Not necessary in mainnet nor in new testnet4. --- src/governance-object.cpp | 57 ++++----------- src/governance-vote.cpp | 60 ++++------------ src/instantx.cpp | 25 +------ src/masternode-payments.cpp | 72 +++++-------------- src/masternode.cpp | 136 +++++++++--------------------------- src/masternodeman.cpp | 105 ++++++++-------------------- src/privatesend.cpp | 41 +---------- src/spork.cpp | 119 ++++++++++--------------------- src/spork.h | 10 +-- 9 files changed, 148 insertions(+), 477 deletions(-) diff --git a/src/governance-object.cpp b/src/governance-object.cpp index 1cfe1edf6e096..f5642a3a2eda1 100644 --- a/src/governance-object.cpp +++ b/src/governance-object.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018 The Dash Core developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -329,30 +330,15 @@ void CGovernanceObject::SetMasternodeOutpoint(const COutPoint& outpoint) bool CGovernanceObject::Sign(const CKey& key, const CKeyID& keyID) { std::string strError; + std::string strMessage = GetSignatureMessage(); + if (!CMessageSigner::SignMessage(strMessage, vchSig, key)) { + LogPrintf("CGovernanceObject::Sign -- SignMessage() failed\n"); + return false; + } - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, key, vchSig)) { - LogPrintf("CGovernanceObject::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, keyID, vchSig, strError)) { - LogPrintf("CGovernanceObject::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } - } else { - std::string strMessage = GetSignatureMessage(); - if (!CMessageSigner::SignMessage(strMessage, vchSig, key)) { - LogPrintf("CGovernanceObject::Sign -- SignMessage() failed\n"); - return false; - } - - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - LogPrintf("CGovernanceObject::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { + LogPrintf("CGovernanceObject::Sign -- VerifyMessage() failed, error: %s\n", strError); + return false; } LogPrint("gobject", "CGovernanceObject::Sign -- pubkey id = %s, masternode = %s\n", @@ -364,27 +350,10 @@ bool CGovernanceObject::Sign(const CKey& key, const CKeyID& keyID) bool CGovernanceObject::CheckSignature(const CKeyID& keyID) const { std::string strError; - - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyID, vchSig, strError)) { - // could be an old object - std::string strMessage = GetSignatureMessage(); - - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - // nope, not in old format either - LogPrintf("CGovernance::CheckSignature -- VerifyMessage() failed, error: %s\n", strError); - return false; - } - } - } else { - std::string strMessage = GetSignatureMessage(); - - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - LogPrintf("CGovernance::CheckSignature -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + std::string strMessage = GetSignatureMessage(); + if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { + LogPrintf("CGovernance::CheckSignature -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; diff --git a/src/governance-vote.cpp b/src/governance-vote.cpp index 15a145df12c4f..a38a521fe827c 100644 --- a/src/governance-vote.cpp +++ b/src/governance-vote.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018 The Dash Core developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -148,32 +149,17 @@ uint256 CGovernanceVote::GetSignatureHash() const bool CGovernanceVote::Sign(const CKey& key, const CKeyID& keyID) { std::string strError; + std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" + + std::to_string(nVoteSignal) + "|" + std::to_string(nVoteOutcome) + "|" + std::to_string(nTime); - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, key, vchSig)) { - LogPrintf("CGovernanceVote::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, keyID, vchSig, strError)) { - LogPrintf("CGovernanceVote::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } - } else { - std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" + - std::to_string(nVoteSignal) + "|" + std::to_string(nVoteOutcome) + "|" + std::to_string(nTime); - - if (!CMessageSigner::SignMessage(strMessage, vchSig, key)) { - LogPrintf("CGovernanceVote::Sign -- SignMessage() failed\n"); - return false; - } + if (!CMessageSigner::SignMessage(strMessage, vchSig, key)) { + LogPrintf("CGovernanceVote::Sign -- SignMessage() failed\n"); + return false; + } - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - LogPrintf("CGovernanceVote::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { + LogPrintf("CGovernanceVote::Sign -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; @@ -183,32 +169,14 @@ bool CGovernanceVote::CheckSignature(const CKeyID& keyID) const { std::string strError; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyID, vchSig, strError)) { - // could be a signature in old format - std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" + - std::to_string(nVoteSignal) + "|" + - std::to_string(nVoteOutcome) + "|" + - std::to_string(nTime); - - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - // nope, not in old format either - LogPrint("gobject", "CGovernanceVote::IsValid -- VerifyMessage() failed, error: %s\n", strError); - return false; - } - } - } else { - std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" + + std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" + std::to_string(nVoteSignal) + "|" + std::to_string(nVoteOutcome) + "|" + std::to_string(nTime); - if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { - LogPrint("gobject", "CGovernanceVote::IsValid -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) { + LogPrint("gobject", "CGovernanceVote::IsValid -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; diff --git a/src/instantx.cpp b/src/instantx.cpp index d1165cbbada54..a9e93227a629d 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -1121,18 +1122,6 @@ bool CTxLockVote::CheckSignature() const LogPrintf("CTxLockVote::CheckSignature -- VerifyInsecure() failed\n"); return false; } - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, infoMn.legacyKeyIDOperator, vchMasternodeSignature, strError)) { - // could be a signature in old format - std::string strMessage = txHash.ToString() + outpoint.ToStringShort(); - if (!CMessageSigner::VerifyMessage(infoMn.legacyKeyIDOperator, vchMasternodeSignature, strMessage, strError)) { - // nope, not in old format either - LogPrintf("CTxLockVote::CheckSignature -- VerifyMessage() failed, error: %s\n", strError); - return false; - } - } } else { std::string strMessage = txHash.ToString() + outpoint.ToStringShort(); if (!CMessageSigner::VerifyMessage(infoMn.legacyKeyIDOperator, vchMasternodeSignature, strMessage, strError)) { @@ -1156,18 +1145,6 @@ bool CTxLockVote::Sign() return false; } sig.GetBuf(vchMasternodeSignature); - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, activeMasternodeInfo.legacyKeyOperator, vchMasternodeSignature)) { - LogPrintf("CTxLockVote::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, activeMasternodeInfo.legacyKeyIDOperator, vchMasternodeSignature, strError)) { - LogPrintf("CTxLockVote::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } } else { std::string strMessage = txHash.ToString() + outpoint.ToStringShort(); diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index c9b264806dbf1..1aeff39395db5 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -554,33 +555,18 @@ uint256 CMasternodePaymentVote::GetSignatureHash() const bool CMasternodePaymentVote::Sign() { std::string strError; - - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if(!CHashSigner::SignHash(hash, activeMasternodeInfo.legacyKeyOperator, vchSig)) { - LogPrintf("CMasternodePaymentVote::%s -- SignHash() failed\n", __func__); - return false; - } - - if (!CHashSigner::VerifyHash(hash, activeMasternodeInfo.legacyKeyIDOperator, vchSig, strError)) { - LogPrintf("CMasternodePaymentVote::%s -- VerifyHash() failed, error: %s\n", __func__, strError); - return false; - } - } else { - std::string strMessage = masternodeOutpoint.ToStringShort() + + std::string strMessage = masternodeOutpoint.ToStringShort() + std::to_string(nBlockHeight) + ScriptToAsmStr(payee); - if(!CMessageSigner::SignMessage(strMessage, vchSig, activeMasternodeInfo.legacyKeyOperator)) { - LogPrintf("CMasternodePaymentVote::%s -- SignMessage() failed\n", __func__); - return false; - } + if(!CMessageSigner::SignMessage(strMessage, vchSig, activeMasternodeInfo.legacyKeyOperator)) { + LogPrintf("CMasternodePaymentVote::%s -- SignMessage() failed\n", __func__); + return false; + } - if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, vchSig, strMessage, strError)) { - LogPrintf("CMasternodePaymentVote::%s -- VerifyMessage() failed, error: %s\n", __func__, strError); - return false; - } + if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, vchSig, strMessage, strError)) { + LogPrintf("CMasternodePaymentVote::%s -- VerifyMessage() failed, error: %s\n", __func__, strError); + return false; } return true; @@ -1107,41 +1093,19 @@ bool CMasternodePaymentVote::CheckSignature(const CKeyID& keyIDOperator, int nVa nDos = 0; std::string strError = ""; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyIDOperator, vchSig, strError)) { - // could be a signature in old format - std::string strMessage = masternodeOutpoint.ToStringShort() + - std::to_string(nBlockHeight) + - ScriptToAsmStr(payee); - if(!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { - // nope, not in old format either - // Only ban for future block vote when we are already synced. - // Otherwise it could be the case when MN which signed this vote is using another key now - // and we have no idea about the old one. - if(masternodeSync.IsMasternodeListSynced() && nBlockHeight > nValidationHeight) { - nDos = 20; - } - return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", - masternodeOutpoint.ToStringShort(), strError); - } - } - } else { - std::string strMessage = masternodeOutpoint.ToStringShort() + + std::string strMessage = masternodeOutpoint.ToStringShort() + std::to_string(nBlockHeight) + ScriptToAsmStr(payee); - if (!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { - // Only ban for future block vote when we are already synced. - // Otherwise it could be the case when MN which signed this vote is using another key now - // and we have no idea about the old one. - if(masternodeSync.IsMasternodeListSynced() && nBlockHeight > nValidationHeight) { - nDos = 20; - } - return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", - masternodeOutpoint.ToStringShort(), strError); + if (!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { + // Only ban for future block vote when we are already synced. + // Otherwise it could be the case when MN which signed this vote is using another key now + // and we have no idea about the old one. + if(masternodeSync.IsMasternodeListSynced() && nBlockHeight > nValidationHeight) { + nDos = 20; } + return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", + masternodeOutpoint.ToStringShort(), strError); } return true; diff --git a/src/masternode.cpp b/src/masternode.cpp index a0437e1ce36af..527c9f7dd3ef0 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers -// Copyright (c) 2018-2021 The Documentchain developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -652,32 +652,18 @@ bool CMasternodeBroadcast::Sign(const CKey& keyCollateralAddress) sigTime = GetAdjustedTime(); - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, keyCollateralAddress, vchSig)) { - LogPrintf("CMasternodeBroadcast::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, keyIDCollateralAddress, vchSig, strError)) { - LogPrintf("CMasternodeBroadcast::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } - } else { - std::string strMessage = addr.ToString(false) + std::to_string(sigTime) + + std::string strMessage = addr.ToString(false) + std::to_string(sigTime) + keyIDCollateralAddress.ToString() + legacyKeyIDOperator.ToString() + std::to_string(nProtocolVersion); - if (!CMessageSigner::SignMessage(strMessage, vchSig, keyCollateralAddress)) { - LogPrintf("CMasternodeBroadcast::Sign -- SignMessage() failed\n"); - return false; - } + if (!CMessageSigner::SignMessage(strMessage, vchSig, keyCollateralAddress)) { + LogPrintf("CMasternodeBroadcast::Sign -- SignMessage() failed\n"); + return false; + } - if(!CMessageSigner::VerifyMessage(keyIDCollateralAddress, vchSig, strMessage, strError)) { - LogPrintf("CMasternodeBroadcast::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if(!CMessageSigner::VerifyMessage(keyIDCollateralAddress, vchSig, strMessage, strError)) { + LogPrintf("CMasternodeBroadcast::Sign -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; @@ -688,32 +674,14 @@ bool CMasternodeBroadcast::CheckSignature(int& nDos) const std::string strError = ""; nDos = 0; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyIDCollateralAddress, vchSig, strError)) { - // maybe it's in old format - std::string strMessage = addr.ToString(false) + std::to_string(sigTime) + - keyIDCollateralAddress.ToString() + legacyKeyIDOperator.ToString() + - std::to_string(nProtocolVersion); - - if (!CMessageSigner::VerifyMessage(keyIDCollateralAddress, vchSig, strMessage, strError)){ - // nope, not in old format either - LogPrintf("CMasternodeBroadcast::CheckSignature -- Got bad Masternode announce signature, error: %s\n", strError); - nDos = 100; - return false; - } - } - } else { - std::string strMessage = addr.ToString(false) + std::to_string(sigTime) + + std::string strMessage = addr.ToString(false) + std::to_string(sigTime) + keyIDCollateralAddress.ToString() + legacyKeyIDOperator.ToString() + std::to_string(nProtocolVersion); - if(!CMessageSigner::VerifyMessage(keyIDCollateralAddress, vchSig, strMessage, strError)){ - LogPrintf("CMasternodeBroadcast::CheckSignature -- Got bad Masternode announce signature, error: %s\n", strError); - nDos = 100; - return false; - } + if(!CMessageSigner::VerifyMessage(keyIDCollateralAddress, vchSig, strMessage, strError)){ + LogPrintf("CMasternodeBroadcast::CheckSignature -- Got bad Masternode announce signature, error: %s\n", strError); + nDos = 100; + return false; } return true; @@ -734,20 +702,9 @@ void CMasternodeBroadcast::Relay(CConnman& connman) const uint256 CMasternodePing::GetHash() const { CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION); - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - // TODO: replace with "return SerializeHash(*this);" after migration to 70209 - ss << masternodeOutpoint; - ss << blockHash; - ss << sigTime; - ss << fSentinelIsCurrent; - ss << nSentinelVersion; - ss << nDaemonVersion; - } else { - // Note: doesn't match serialization - - ss << masternodeOutpoint << uint8_t{} << 0xffffffff; // adding dummy values here to match old hashing format - ss << sigTime; - } + ss << masternodeOutpoint << uint8_t{} << 0xffffffff; // adding dummy values here to match old hashing format + ss << sigTime; + return ss.GetHash(); } @@ -773,31 +730,17 @@ bool CMasternodePing::Sign(const CKey& keyMasternode, const CKeyID& keyIDOperato sigTime = GetAdjustedTime(); - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, keyMasternode, vchSig)) { - LogPrintf("CMasternodePing::Sign -- SignHash() failed\n"); - return false; - } + std::string strMessage = CTxIn(masternodeOutpoint).ToString() + blockHash.ToString() + + std::to_string(sigTime); - if (!CHashSigner::VerifyHash(hash, keyIDOperator, vchSig, strError)) { - LogPrintf("CMasternodePing::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } - } else { - std::string strMessage = CTxIn(masternodeOutpoint).ToString() + blockHash.ToString() + - std::to_string(sigTime); - - if (!CMessageSigner::SignMessage(strMessage, vchSig, keyMasternode)) { - LogPrintf("CMasternodePing::Sign -- SignMessage() failed\n"); - return false; - } + if (!CMessageSigner::SignMessage(strMessage, vchSig, keyMasternode)) { + LogPrintf("CMasternodePing::Sign -- SignMessage() failed\n"); + return false; + } - if(!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { - LogPrintf("CMasternodePing::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if(!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { + LogPrintf("CMasternodePing::Sign -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; @@ -808,28 +751,13 @@ bool CMasternodePing::CheckSignature(CKeyID& keyIDOperator, int &nDos) const std::string strError = ""; nDos = 0; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); + std::string strMessage = CTxIn(masternodeOutpoint).ToString() + blockHash.ToString() + + std::to_string(sigTime); - if (!CHashSigner::VerifyHash(hash, keyIDOperator, vchSig, strError)) { - std::string strMessage = CTxIn(masternodeOutpoint).ToString() + blockHash.ToString() + - std::to_string(sigTime); - - if(!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { - LogPrintf("CMasternodePing::CheckSignature -- Got bad Masternode ping signature, masternode=%s, error: %s\n", masternodeOutpoint.ToStringShort(), strError); - nDos = 33; - return false; - } - } - } else { - std::string strMessage = CTxIn(masternodeOutpoint).ToString() + blockHash.ToString() + - std::to_string(sigTime); - - if (!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { - LogPrintf("CMasternodePing::CheckSignature -- Got bad Masternode ping signature, masternode=%s, error: %s\n", masternodeOutpoint.ToStringShort(), strError); - nDos = 33; - return false; - } + if (!CMessageSigner::VerifyMessage(keyIDOperator, vchSig, strMessage, strError)) { + LogPrintf("CMasternodePing::CheckSignature -- Got bad Masternode ping signature, masternode=%s, error: %s\n", masternodeOutpoint.ToStringShort(), strError); + nDos = 33; + return false; } return true; diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index be5aa5c2f3cb1..1c59a803ccf5b 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers -// Copyright (c) 2018-2021 The Documentchain developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -1408,31 +1408,16 @@ void CMasternodeMan::SendVerifyReply(CNode* pnode, CMasternodeVerification& mnv, } std::string strError; + std::string strMessage = strprintf("%s%d%s", activeMasternodeInfo.service.ToString(false), mnv.nonce, blockHash.ToString()); - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = mnv.GetSignatureHash1(blockHash); - - if(!CHashSigner::SignHash(hash, activeMasternodeInfo.legacyKeyOperator, mnv.vchSig1)) { - LogPrintf("CMasternodeMan::SendVerifyReply -- SignHash() failed\n"); - return; - } - - if (!CHashSigner::VerifyHash(hash, activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig1, strError)) { - LogPrintf("CMasternodeMan::SendVerifyReply -- VerifyHash() failed, error: %s\n", strError); - return; - } - } else { - std::string strMessage = strprintf("%s%d%s", activeMasternodeInfo.service.ToString(false), mnv.nonce, blockHash.ToString()); - - if(!CMessageSigner::SignMessage(strMessage, mnv.vchSig1, activeMasternodeInfo.legacyKeyOperator)) { - LogPrintf("MasternodeMan::SendVerifyReply -- SignMessage() failed\n"); - return; - } + if(!CMessageSigner::SignMessage(strMessage, mnv.vchSig1, activeMasternodeInfo.legacyKeyOperator)) { + LogPrintf("MasternodeMan::SendVerifyReply -- SignMessage() failed\n"); + return; + } - if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig1, strMessage, strError)) { - LogPrintf("MasternodeMan::SendVerifyReply -- VerifyMessage() failed, error: %s\n", strError); - return; - } + if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig1, strMessage, strError)) { + LogPrintf("MasternodeMan::SendVerifyReply -- VerifyMessage() failed, error: %s\n", strError); + return; } CNetMsgMaker msgMaker(pnode->GetSendVersion()); @@ -1498,12 +1483,7 @@ void CMasternodeMan::ProcessVerifyReply(CNode* pnode, CMasternodeVerification& m for (auto& mnpair : mapMasternodes) { if(CAddress(mnpair.second.addr, NODE_NETWORK) == pnode->addr) { bool fFound = false; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - fFound = CHashSigner::VerifyHash(hash1, mnpair.second.legacyKeyIDOperator, mnv.vchSig1, strError); - // we don't care about mnv with signature in old format - } else { - fFound = CMessageSigner::VerifyMessage(mnpair.second.legacyKeyIDOperator, mnv.vchSig1, strMessage1, strError); - } + fFound = CMessageSigner::VerifyMessage(mnpair.second.legacyKeyIDOperator, mnv.vchSig1, strMessage1, strError); if (fFound) { // found it! prealMasternode = &mnpair.second; @@ -1521,31 +1501,17 @@ void CMasternodeMan::ProcessVerifyReply(CNode* pnode, CMasternodeVerification& m // ... and sign it std::string strError; - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash2 = mnv.GetSignatureHash2(blockHash); - - if(!CHashSigner::SignHash(hash2, activeMasternodeInfo.legacyKeyOperator, mnv.vchSig2)) { - LogPrintf("MasternodeMan::ProcessVerifyReply -- SignHash() failed\n"); - return; - } - - if(!CHashSigner::VerifyHash(hash2, activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig2, strError)) { - LogPrintf("MasternodeMan::ProcessVerifyReply -- VerifyHash() failed, error: %s\n", strError); - return; - } - } else { - std::string strMessage2 = strprintf("%s%d%s%s%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString(), + std::string strMessage2 = strprintf("%s%d%s%s%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString(), mnv.masternodeOutpoint1.ToStringShort(), mnv.masternodeOutpoint2.ToStringShort()); - if(!CMessageSigner::SignMessage(strMessage2, mnv.vchSig2, activeMasternodeInfo.legacyKeyOperator)) { - LogPrintf("MasternodeMan::ProcessVerifyReply -- SignMessage() failed\n"); - return; - } + if(!CMessageSigner::SignMessage(strMessage2, mnv.vchSig2, activeMasternodeInfo.legacyKeyOperator)) { + LogPrintf("MasternodeMan::ProcessVerifyReply -- SignMessage() failed\n"); + return; + } - if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig2, strMessage2, strError)) { - LogPrintf("MasternodeMan::ProcessVerifyReply -- VerifyMessage() failed, error: %s\n", strError); - return; - } + if(!CMessageSigner::VerifyMessage(activeMasternodeInfo.legacyKeyIDOperator, mnv.vchSig2, strMessage2, strError)) { + LogPrintf("MasternodeMan::ProcessVerifyReply -- VerifyMessage() failed, error: %s\n", strError); + return; } mWeAskedForVerification[pnode->addr] = mnv; @@ -1651,33 +1617,18 @@ void CMasternodeMan::ProcessVerifyBroadcast(CNode* pnode, const CMasternodeVerif return; } - if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash1 = mnv.GetSignatureHash1(blockHash); - uint256 hash2 = mnv.GetSignatureHash2(blockHash); + std::string strMessage1 = strprintf("%s%d%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString()); + std::string strMessage2 = strprintf("%s%d%s%s%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString(), + mnv.masternodeOutpoint1.ToStringShort(), mnv.masternodeOutpoint2.ToStringShort()); - if(!CHashSigner::VerifyHash(hash1, pmn1->legacyKeyIDOperator, mnv.vchSig1, strError)) { - LogPrintf("MasternodeMan::ProcessVerifyBroadcast -- VerifyHash() failed, error: %s\n", strError); - return; - } - - if(!CHashSigner::VerifyHash(hash2, pmn2->legacyKeyIDOperator, mnv.vchSig2, strError)) { - LogPrintf("MasternodeMan::ProcessVerifyBroadcast -- VerifyHash() failed, error: %s\n", strError); - return; - } - } else { - std::string strMessage1 = strprintf("%s%d%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString()); - std::string strMessage2 = strprintf("%s%d%s%s%s", mnv.addr.ToString(false), mnv.nonce, blockHash.ToString(), - mnv.masternodeOutpoint1.ToStringShort(), mnv.masternodeOutpoint2.ToStringShort()); - - if(!CMessageSigner::VerifyMessage(pmn1->legacyKeyIDOperator, mnv.vchSig1, strMessage1, strError)) { - LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- VerifyMessage() for masternode1 failed, error: %s\n", strError); - return; - } + if(!CMessageSigner::VerifyMessage(pmn1->legacyKeyIDOperator, mnv.vchSig1, strMessage1, strError)) { + LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- VerifyMessage() for masternode1 failed, error: %s\n", strError); + return; + } - if(!CMessageSigner::VerifyMessage(pmn2->legacyKeyIDOperator, mnv.vchSig2, strMessage2, strError)) { - LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- VerifyMessage() for masternode2 failed, error: %s\n", strError); - return; - } + if(!CMessageSigner::VerifyMessage(pmn2->legacyKeyIDOperator, mnv.vchSig2, strMessage2, strError)) { + LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- VerifyMessage() for masternode2 failed, error: %s\n", strError); + return; } if(!pmn1->IsPoSeVerified()) { diff --git a/src/privatesend.cpp b/src/privatesend.cpp index 50bce84d0af15..40c25fc8137c2 100644 --- a/src/privatesend.cpp +++ b/src/privatesend.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018 The Dash Core developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -59,18 +60,6 @@ bool CPrivateSendQueue::Sign() return false; } sig.GetBuf(vchSig); - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, activeMasternodeInfo.legacyKeyOperator, vchSig)) { - LogPrintf("CPrivateSendQueue::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, activeMasternodeInfo.legacyKeyIDOperator, vchSig, strError)) { - LogPrintf("CPrivateSendQueue::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } } else { std::string strMessage = CTxIn(masternodeOutpoint).ToString() + std::to_string(nDenom) + @@ -103,14 +92,6 @@ bool CPrivateSendQueue::CheckSignature(const CKeyID& keyIDOperator, const CBLSPu LogPrintf("CTxLockVote::CheckSignature -- VerifyInsecure() failed\n"); return false; } - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyIDOperator, vchSig, strError)) { - // we don't care about queues with old signature format - LogPrintf("CPrivateSendQueue::CheckSignature -- VerifyHash() failed, error: %s\n", strError); - return false; - } } else { std::string strMessage = CTxIn(masternodeOutpoint).ToString() + std::to_string(nDenom) + @@ -155,18 +136,6 @@ bool CPrivateSendBroadcastTx::Sign() return false; } sig.GetBuf(vchSig); - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::SignHash(hash, activeMasternodeInfo.legacyKeyOperator, vchSig)) { - LogPrintf("CPrivateSendBroadcastTx::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, activeMasternodeInfo.legacyKeyIDOperator, vchSig, strError)) { - LogPrintf("CPrivateSendBroadcastTx::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } } else { std::string strMessage = tx->GetHash().ToString() + std::to_string(sigTime); @@ -197,14 +166,6 @@ bool CPrivateSendBroadcastTx::CheckSignature(const CKeyID& keyIDOperator, const LogPrintf("CTxLockVote::CheckSignature -- VerifyInsecure() failed\n"); return false; } - } else if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) { - uint256 hash = GetSignatureHash(); - - if (!CHashSigner::VerifyHash(hash, keyIDOperator, vchSig, strError)) { - // we don't care about dstxes with old signature format - LogPrintf("CPrivateSendBroadcastTx::CheckSignature -- VerifyHash() failed, error: %s\n", strError); - return false; - } } else { std::string strMessage = tx->GetHash().ToString() + std::to_string(sigTime); diff --git a/src/spork.cpp b/src/spork.cpp index 06f6b051603c5..30c720a8ceff6 100644 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers -// Copyright (c) 2018 The Documentchain developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,7 +22,7 @@ std::map mapSporkDefaults = { {SPORK_2_INSTANTSEND_ENABLED, 0}, // ON {SPORK_3_INSTANTSEND_BLOCK_FILTERING, 0}, // ON {SPORK_5_INSTANTSEND_MAX_VALUE, 1000}, // 1000 DMS - {SPORK_6_NEW_SIGS, 4070908800ULL}, // OFF + {SPORK_6_FREE, 4070908800ULL}, // OFF {SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT, 1545836400ULL}, // 12/27/2018 {SPORK_9_SUPERBLOCKS_ENABLED, 4070908800ULL}, // OFF {SPORK_10_MASTERNODE_PAY_UPDATED_NODES, 4070908800ULL}, // OFF @@ -77,12 +77,10 @@ void CSporkManager::CheckAndRemove() mapSporksByHash.erase(itSignerPair->second.GetHash()); continue; } - if (!itSignerPair->second.CheckSignature(itSignerPair->first, false)) { - if (!itSignerPair->second.CheckSignature(itSignerPair->first, true)) { - mapSporksByHash.erase(itSignerPair->second.GetHash()); - itActive->second.erase(itSignerPair++); - continue; - } + if (!itSignerPair->second.CheckSignature(itSignerPair->first)) { + mapSporksByHash.erase(itSignerPair->second.GetHash()); + itActive->second.erase(itSignerPair++); + continue; } ++itSignerPair; } @@ -97,8 +95,7 @@ void CSporkManager::CheckAndRemove() while (itByHash != mapSporksByHash.end()) { bool found = false; for (const auto& signer: setSporkPubKeyIDs) { - if (itByHash->second.CheckSignature(signer, false) || - itByHash->second.CheckSignature(signer, true)) { + if (itByHash->second.CheckSignature(signer)) { found = true; break; } @@ -138,19 +135,11 @@ void CSporkManager::ProcessSpork(CNode* pfrom, const std::string& strCommand, CD } CKeyID keyIDSigner; - bool fSpork6IsActive = IsSporkActive(SPORK_6_NEW_SIGS); - if (!spork.GetSignerKeyID(keyIDSigner, fSpork6IsActive) - || !setSporkPubKeyIDs.count(keyIDSigner)) { - // Note: unlike for other messages we have to check for new format even with SPORK_6_NEW_SIGS - // inactive because SPORK_6_NEW_SIGS default is OFF and it is not the first spork to sync - // (and even if it would, spork order can't be guaranteed anyway). - if (!spork.GetSignerKeyID(keyIDSigner, !fSpork6IsActive) - || !setSporkPubKeyIDs.count(keyIDSigner)) { - LOCK(cs_main); - LogPrintf("CSporkManager::ProcessSpork -- ERROR: invalid signature\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } + if (!spork.GetSignerKeyID(keyIDSigner) || !setSporkPubKeyIDs.count(keyIDSigner)) { + LOCK(cs_main); + LogPrintf("CSporkManager::ProcessSpork -- ERROR: invalid signature\n"); + Misbehaving(pfrom->GetId(), 100); + return; } { @@ -229,10 +218,9 @@ bool CSporkManager::UpdateSpork(int nSporkID, int64_t nValue, CConnman& connman) { CSporkMessage spork = CSporkMessage(nSporkID, nValue, GetAdjustedTime()); - bool fSpork6IsActive = IsSporkActive(SPORK_6_NEW_SIGS); - if(spork.Sign(sporkPrivKey, fSpork6IsActive)) { + if(spork.Sign(sporkPrivKey)) { CKeyID keyIDSigner; - if (!spork.GetSignerKeyID(keyIDSigner, fSpork6IsActive) || !setSporkPubKeyIDs.count(keyIDSigner)) { + if (!spork.GetSignerKeyID(keyIDSigner) || !setSporkPubKeyIDs.count(keyIDSigner)) { LogPrintf("CSporkManager::UpdateSpork: failed to find keyid for private key\n"); return false; } @@ -285,7 +273,7 @@ int CSporkManager::GetSporkIDByName(const std::string& strName) if (strName == "SPORK_2_INSTANTSEND_ENABLED") return SPORK_2_INSTANTSEND_ENABLED; if (strName == "SPORK_3_INSTANTSEND_BLOCK_FILTERING") return SPORK_3_INSTANTSEND_BLOCK_FILTERING; if (strName == "SPORK_5_INSTANTSEND_MAX_VALUE") return SPORK_5_INSTANTSEND_MAX_VALUE; - if (strName == "SPORK_6_NEW_SIGS") return SPORK_6_NEW_SIGS; + if (strName == "SPORK_6_FREE") return SPORK_6_FREE; if (strName == "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT") return SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT; if (strName == "SPORK_9_SUPERBLOCKS_ENABLED") return SPORK_9_SUPERBLOCKS_ENABLED; if (strName == "SPORK_10_MASTERNODE_PAY_UPDATED_NODES") return SPORK_10_MASTERNODE_PAY_UPDATED_NODES; @@ -305,7 +293,7 @@ std::string CSporkManager::GetSporkNameByID(int nSporkID) case SPORK_2_INSTANTSEND_ENABLED: return "SPORK_2_INSTANTSEND_ENABLED"; case SPORK_3_INSTANTSEND_BLOCK_FILTERING: return "SPORK_3_INSTANTSEND_BLOCK_FILTERING"; case SPORK_5_INSTANTSEND_MAX_VALUE: return "SPORK_5_INSTANTSEND_MAX_VALUE"; - case SPORK_6_NEW_SIGS: return "SPORK_6_NEW_SIGS"; + case SPORK_6_FREE: return "SPORK_6_FREE"; case SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT: return "SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT"; case SPORK_9_SUPERBLOCKS_ENABLED: return "SPORK_9_SUPERBLOCKS_ENABLED"; case SPORK_10_MASTERNODE_PAY_UPDATED_NODES: return "SPORK_10_MASTERNODE_PAY_UPDATED_NODES"; @@ -372,7 +360,7 @@ bool CSporkManager::SetPrivKey(const std::string& strPrivKey) } CSporkMessage spork; - if (spork.Sign(key, IsSporkActive(SPORK_6_NEW_SIGS))) { + if (spork.Sign(key)) { LOCK(cs); // Test signing successful, proceed LogPrintf("CSporkManager::SetPrivKey -- Successfully initialized as spork signer\n"); @@ -405,7 +393,7 @@ uint256 CSporkMessage::GetSignatureHash() const return s.GetHash(); } -bool CSporkMessage::Sign(const CKey& key, bool fSporkSixActive) +bool CSporkMessage::Sign(const CKey& key) { if (!key.IsValid()) { LogPrintf("CSporkMessage::Sign -- signing key is not valid\n"); @@ -415,81 +403,46 @@ bool CSporkMessage::Sign(const CKey& key, bool fSporkSixActive) CKeyID pubKeyId = key.GetPubKey().GetID(); std::string strError = ""; - if (fSporkSixActive) { - uint256 hash = GetSignatureHash(); + std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); - if(!CHashSigner::SignHash(hash, key, vchSig)) { - LogPrintf("CSporkMessage::Sign -- SignHash() failed\n"); - return false; - } - - if (!CHashSigner::VerifyHash(hash, pubKeyId, vchSig, strError)) { - LogPrintf("CSporkMessage::Sign -- VerifyHash() failed, error: %s\n", strError); - return false; - } - } else { - std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); - - if(!CMessageSigner::SignMessage(strMessage, vchSig, key)) { - LogPrintf("CSporkMessage::Sign -- SignMessage() failed\n"); - return false; - } + if(!CMessageSigner::SignMessage(strMessage, vchSig, key)) { + LogPrintf("CSporkMessage::Sign -- SignMessage() failed\n"); + return false; + } - if(!CMessageSigner::VerifyMessage(pubKeyId, vchSig, strMessage, strError)) { - LogPrintf("CSporkMessage::Sign -- VerifyMessage() failed, error: %s\n", strError); - return false; - } + if(!CMessageSigner::VerifyMessage(pubKeyId, vchSig, strMessage, strError)) { + LogPrintf("CSporkMessage::Sign -- VerifyMessage() failed, error: %s\n", strError); + return false; } return true; } -bool CSporkMessage::CheckSignature(const CKeyID& pubKeyId, bool fSporkSixActive) const +bool CSporkMessage::CheckSignature(const CKeyID& pubKeyId) const { std::string strError = ""; + std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); - if (fSporkSixActive) { + if (!CMessageSigner::VerifyMessage(pubKeyId, vchSig, strMessage, strError)){ uint256 hash = GetSignatureHash(); - if (!CHashSigner::VerifyHash(hash, pubKeyId, vchSig, strError)) { - // Note: unlike for many other messages when SPORK_6_NEW_SIGS is ON sporks with sigs in old format - // and newer timestamps should not be accepted, so if we failed here - that's it LogPrintf("CSporkMessage::CheckSignature -- VerifyHash() failed, error: %s\n", strError); return false; } - } else { - std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); - - if (!CMessageSigner::VerifyMessage(pubKeyId, vchSig, strMessage, strError)){ - // Note: unlike for other messages we have to check for new format even with SPORK_6_NEW_SIGS - // inactive because SPORK_6_NEW_SIGS default is OFF and it is not the first spork to sync - // (and even if it would, spork order can't be guaranteed anyway). - uint256 hash = GetSignatureHash(); - if (!CHashSigner::VerifyHash(hash, pubKeyId, vchSig, strError)) { - LogPrintf("CSporkMessage::CheckSignature -- VerifyHash() failed, error: %s\n", strError); - return false; - } - } } return true; } -bool CSporkMessage::GetSignerKeyID(CKeyID &retKeyidSporkSigner, bool fSporkSixActive) +bool CSporkMessage::GetSignerKeyID(CKeyID &retKeyidSporkSigner) { CPubKey pubkeyFromSig; - if (fSporkSixActive) { - if (!pubkeyFromSig.RecoverCompact(GetSignatureHash(), vchSig)) { - return false; - } - } else { - std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); - CHashWriter ss(SER_GETHASH, 0); - ss << strMessageMagic; - ss << strMessage; - if (!pubkeyFromSig.RecoverCompact(ss.GetHash(), vchSig)) { - return false; - } + std::string strMessage = std::to_string(nSporkID) + std::to_string(nValue) + std::to_string(nTimeSigned); + CHashWriter ss(SER_GETHASH, 0); + ss << strMessageMagic; + ss << strMessage; + if (!pubkeyFromSig.RecoverCompact(ss.GetHash(), vchSig)) { + return false; } retKeyidSporkSigner = pubkeyFromSig.GetID(); diff --git a/src/spork.h b/src/spork.h index 88e4a0deca2a6..a89851ac0d164 100644 --- a/src/spork.h +++ b/src/spork.h @@ -1,5 +1,5 @@ // Copyright (c) 2014-2017 The Dash Core developers -// Copyright (c) 2018 The Documentchain developers +// Copyright (c) 2018-2022 The Documentchain developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,7 +22,7 @@ class CSporkManager; static const int SPORK_2_INSTANTSEND_ENABLED = 10001; static const int SPORK_3_INSTANTSEND_BLOCK_FILTERING = 10002; static const int SPORK_5_INSTANTSEND_MAX_VALUE = 10004; -static const int SPORK_6_NEW_SIGS = 10005; +static const int SPORK_6_FREE /* not used */ = 10005; static const int SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT = 10007; static const int SPORK_9_SUPERBLOCKS_ENABLED = 10008; static const int SPORK_10_MASTERNODE_PAY_UPDATED_NODES = 10009; @@ -104,13 +104,13 @@ class CSporkMessage /** * Sign will sign the spork message with the given key. */ - bool Sign(const CKey& key, bool fSporkSixActive); + bool Sign(const CKey& key); /** * CheckSignature will ensure the spork signature matches the provided public * key hash. */ - bool CheckSignature(const CKeyID& pubKeyId, bool fSporkSixActive) const; + bool CheckSignature(const CKeyID& pubKeyId) const; /** * GetSignerKeyID is used to recover the spork address of the key used to @@ -119,7 +119,7 @@ class CSporkMessage * This method was introduced along with the multi-signer sporks feature, * in order to identify which spork key signed this message. */ - bool GetSignerKeyID(CKeyID& retKeyidSporkSigner, bool fSporkSixActive); + bool GetSignerKeyID(CKeyID& retKeyidSporkSigner); /** * Relay is used to send this spork message to other peers.