From 619c0f8104de8e4b0966e295f887067e33de021e Mon Sep 17 00:00:00 2001 From: random-zebra Date: Fri, 17 Sep 2021 19:07:35 +0200 Subject: [PATCH] scripted-diff: Rename keyIDOperator to pubKeyOperator -BEGIN VERIFY SCRIPT- sed -i 's/keyIDOperator/pubKeyOperator/g' src/*.h src/*.cpp src/*/*.h src/*/*.cpp; sed -i 's/operatorAddress/operatorPubKey/g' src/*.h src/*.cpp src/*/*.h src/*/*.cpp; -END VERIFY SCRIPT- --- src/activemasternode.cpp | 10 +++--- src/activemasternode.h | 2 +- src/budget/budgetmanager.cpp | 2 +- src/evo/deterministicmns.cpp | 28 +++++++-------- src/evo/deterministicmns.h | 12 +++---- src/evo/providertx.cpp | 34 +++++++++--------- src/evo/providertx.h | 8 ++--- src/masternode-payments.cpp | 2 +- src/rpc/budget.cpp | 2 +- src/rpc/masternode.cpp | 4 +-- src/rpc/rpcevo.cpp | 48 ++++++++++++------------- src/test/evo_deterministicmns_tests.cpp | 8 ++--- src/test/evo_specialtx_tests.cpp | 8 ++--- src/txmempool.cpp | 16 ++++----- 14 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index e43c2fb0932d0..a4b28744da2ef 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -60,7 +60,7 @@ OperationResult CActiveDeterministicMasternodeManager::SetOperatorKey(const std: if (strMNOperatorPrivKey.empty()) { return errorOut("ERROR: Masternode operator priv key cannot be empty."); } - if (!CMessageSigner::GetKeysFromSecret(strMNOperatorPrivKey, info.keyOperator, info.keyIDOperator)) { + if (!CMessageSigner::GetKeysFromSecret(strMNOperatorPrivKey, info.keyOperator, info.pubKeyOperator)) { return errorOut(_("Invalid mnoperatorprivatekey. Please see the documentation.")); } return OperationResult(true); @@ -75,12 +75,12 @@ OperationResult CActiveDeterministicMasternodeManager::GetOperatorKey(CKey& key, if (!dmn) { return errorOut(strprintf("Active masternode %s not registered or PoSe banned", info.proTxHash.ToString())); } - if (info.keyIDOperator != dmn->pdmnState->keyIDOperator) { + if (info.pubKeyOperator != dmn->pdmnState->pubKeyOperator) { return errorOut("Active masternode operator key changed or revoked"); } // return keys key = info.keyOperator; - keyID = info.keyIDOperator; + keyID = info.pubKeyOperator; return OperationResult(true); } @@ -119,7 +119,7 @@ void CActiveDeterministicMasternodeManager::Init() CDeterministicMNList mnList = deterministicMNManager->GetListAtChainTip(); - CDeterministicMNCPtr dmn = mnList.GetMNByOperatorKey(info.keyIDOperator); + CDeterministicMNCPtr dmn = mnList.GetMNByOperatorKey(info.pubKeyOperator); if (!dmn) { // MN not appeared on the chain yet return; @@ -192,7 +192,7 @@ void CActiveDeterministicMasternodeManager::UpdatedBlockTip(const CBlockIndex* p return; } - if (newDmn->pdmnState->keyIDOperator != oldDmn->pdmnState->keyIDOperator) { + if (newDmn->pdmnState->pubKeyOperator != oldDmn->pdmnState->pubKeyOperator) { // MN operator key changed or revoked Reset(MASTERNODE_OPERATOR_KEY_CHANGED); return; diff --git a/src/activemasternode.h b/src/activemasternode.h index c85381b3c233b..8b297143316cf 100644 --- a/src/activemasternode.h +++ b/src/activemasternode.h @@ -28,7 +28,7 @@ extern CActiveDeterministicMasternodeManager* activeMasternodeManager; struct CActiveMasternodeInfo { // Keys for the active Masternode - CKeyID keyIDOperator; + CKeyID pubKeyOperator; CKey keyOperator; // Initialized while registering Masternode uint256 proTxHash{UINT256_ZERO}; diff --git a/src/budget/budgetmanager.cpp b/src/budget/budgetmanager.cpp index e9cd28cb7c720..39e907a440cda 100644 --- a/src/budget/budgetmanager.cpp +++ b/src/budget/budgetmanager.cpp @@ -1110,7 +1110,7 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod if (dmn) { const std::string& mn_protx_id = dmn->proTxHash.ToString(); - if (!vote.CheckSignature(dmn->pdmnState->keyIDOperator)) { + if (!vote.CheckSignature(dmn->pdmnState->pubKeyOperator)) { err = strprintf("invalid fbvote sig from dmn: %s", mn_protx_id); return state.DoS(100, false, REJECT_INVALID, "bad-fbvote-sig", false, err); } diff --git a/src/evo/deterministicmns.cpp b/src/evo/deterministicmns.cpp index a535372258aa3..a9898f2077384 100644 --- a/src/evo/deterministicmns.cpp +++ b/src/evo/deterministicmns.cpp @@ -37,9 +37,9 @@ std::string CDeterministicMNState::ToString() const operatorPayoutAddress = EncodeDestination(dest); } - return strprintf("CDeterministicMNState(nRegisteredHeight=%d, nLastPaidHeight=%d, nPoSePenalty=%d, nPoSeRevivedHeight=%d, nPoSeBanHeight=%d, nRevocationReason=%d, ownerAddress=%s, operatorAddress=%s, votingAddress=%s, addr=%s, payoutAddress=%s, operatorPayoutAddress=%s)", + return strprintf("CDeterministicMNState(nRegisteredHeight=%d, nLastPaidHeight=%d, nPoSePenalty=%d, nPoSeRevivedHeight=%d, nPoSeBanHeight=%d, nRevocationReason=%d, ownerAddress=%s, operatorPubKey=%s, votingAddress=%s, addr=%s, payoutAddress=%s, operatorPayoutAddress=%s)", nRegisteredHeight, nLastPaidHeight, nPoSePenalty, nPoSeRevivedHeight, nPoSeBanHeight, nRevocationReason, - EncodeDestination(keyIDOwner), EncodeDestination(keyIDOperator), EncodeDestination(keyIDVoting), addr.ToStringIPPort(), payoutAddress, operatorPayoutAddress); + EncodeDestination(keyIDOwner), EncodeDestination(pubKeyOperator), EncodeDestination(keyIDVoting), addr.ToStringIPPort(), payoutAddress, operatorPayoutAddress); } void CDeterministicMNState::ToJson(UniValue& obj) const @@ -54,7 +54,7 @@ void CDeterministicMNState::ToJson(UniValue& obj) const obj.pushKV("PoSeBanHeight", nPoSeBanHeight); obj.pushKV("revocationReason", nRevocationReason); obj.pushKV("ownerAddress", EncodeDestination(keyIDOwner)); - obj.pushKV("operatorAddress", keyIDOperator == CKeyID() ? "" : EncodeDestination(keyIDOperator)); + obj.pushKV("operatorPubKey", pubKeyOperator == CKeyID() ? "" : EncodeDestination(pubKeyOperator)); obj.pushKV("votingAddress", EncodeDestination(keyIDVoting)); CTxDestination dest1; @@ -125,7 +125,7 @@ CDeterministicMNCPtr CDeterministicMNList::GetValidMN(const uint256& proTxHash) CDeterministicMNCPtr CDeterministicMNList::GetMNByOperatorKey(const CKeyID& keyID) { for (const auto& p : mnMap) { - if (p.second->pdmnState->keyIDOperator == keyID) { + if (p.second->pdmnState->pubKeyOperator == keyID) { return p.second; } } @@ -396,8 +396,8 @@ void CDeterministicMNList::AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTota if (HasUniqueProperty(dmn->pdmnState->addr)) { throw(std::runtime_error(strprintf("%s: can't add a masternode with a duplicate address %s", __func__, dmn->pdmnState->addr.ToStringIPPort()))); } - if (HasUniqueProperty(dmn->pdmnState->keyIDOwner) || HasUniqueProperty(dmn->pdmnState->keyIDOperator)) { - throw(std::runtime_error(strprintf("%s: can't add a masternode with a duplicate key (%s or %s)", __func__, EncodeDestination(dmn->pdmnState->keyIDOwner), EncodeDestination(dmn->pdmnState->keyIDOperator)))); + if (HasUniqueProperty(dmn->pdmnState->keyIDOwner) || HasUniqueProperty(dmn->pdmnState->pubKeyOperator)) { + throw(std::runtime_error(strprintf("%s: can't add a masternode with a duplicate key (%s or %s)", __func__, EncodeDestination(dmn->pdmnState->keyIDOwner), EncodeDestination(dmn->pdmnState->pubKeyOperator)))); } mnMap = mnMap.set(dmn->proTxHash, dmn); @@ -407,7 +407,7 @@ void CDeterministicMNList::AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTota AddUniqueProperty(dmn, dmn->pdmnState->addr); } AddUniqueProperty(dmn, dmn->pdmnState->keyIDOwner); - AddUniqueProperty(dmn, dmn->pdmnState->keyIDOperator); + AddUniqueProperty(dmn, dmn->pdmnState->pubKeyOperator); if (fBumpTotalCount) { // nTotalRegisteredCount acts more like a checkpoint, not as a limit, @@ -430,7 +430,7 @@ void CDeterministicMNList::UpdateMN(const CDeterministicMNCPtr& oldDmn, const CD UpdateUniqueProperty(dmn, oldState->addr, pdmnState->addr); UpdateUniqueProperty(dmn, oldState->keyIDOwner, pdmnState->keyIDOwner); - UpdateUniqueProperty(dmn, oldState->keyIDOperator, pdmnState->keyIDOperator); + UpdateUniqueProperty(dmn, oldState->pubKeyOperator, pdmnState->pubKeyOperator); } void CDeterministicMNList::UpdateMN(const uint256& proTxHash, const CDeterministicMNStateCPtr& pdmnState) @@ -462,7 +462,7 @@ void CDeterministicMNList::RemoveMN(const uint256& proTxHash) DeleteUniqueProperty(dmn, dmn->pdmnState->addr); } DeleteUniqueProperty(dmn, dmn->pdmnState->keyIDOwner); - DeleteUniqueProperty(dmn, dmn->pdmnState->keyIDOperator); + DeleteUniqueProperty(dmn, dmn->pdmnState->pubKeyOperator); mnMap = mnMap.erase(proTxHash); mnInternalIdMap = mnInternalIdMap.erase(dmn->GetInternalId()); @@ -657,7 +657,7 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C if (newList.HasUniqueProperty(pl.keyIDOwner)) { return _state.DoS(100, false, REJECT_DUPLICATE, "bad-protx-dup-owner-key"); } - if (newList.HasUniqueProperty(pl.keyIDOperator)) { + if (newList.HasUniqueProperty(pl.pubKeyOperator)) { return _state.DoS(100, false, REJECT_DUPLICATE, "bad-protx-dup-operator-key"); } @@ -702,7 +702,7 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C if (newState->nPoSeBanHeight != -1) { // only revive when all keys are set - if (!newState->keyIDOperator.IsNull() && !newState->keyIDVoting.IsNull() && !newState->keyIDOwner.IsNull()) { + if (!newState->pubKeyOperator.IsNull() && !newState->keyIDVoting.IsNull() && !newState->keyIDOwner.IsNull()) { newState->nPoSePenalty = 0; newState->nPoSeBanHeight = -1; newState->nPoSeRevivedHeight = nHeight; @@ -730,16 +730,16 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C if (!dmn) { return _state.DoS(100, false, REJECT_INVALID, "bad-protx-hash"); } - if (newList.HasUniqueProperty(pl.keyIDOperator) && newList.GetUniquePropertyMN(pl.keyIDOperator)->proTxHash != pl.proTxHash) { + if (newList.HasUniqueProperty(pl.pubKeyOperator) && newList.GetUniquePropertyMN(pl.pubKeyOperator)->proTxHash != pl.proTxHash) { return _state.DoS(100, false, REJECT_DUPLICATE, "bad-protx-dup-operator-key"); } auto newState = std::make_shared(*dmn->pdmnState); - if (newState->keyIDOperator != pl.keyIDOperator) { + if (newState->pubKeyOperator != pl.pubKeyOperator) { // reset all operator related fields and put MN into PoSe-banned state in case the operator key changes newState->ResetOperatorFields(); newState->BanIfNotBanned(nHeight); } - newState->keyIDOperator = pl.keyIDOperator; + newState->pubKeyOperator = pl.pubKeyOperator; newState->keyIDVoting = pl.keyIDVoting; newState->scriptPayout = pl.scriptPayout; diff --git a/src/evo/deterministicmns.h b/src/evo/deterministicmns.h index a761a6d48f918..b8993cf748929 100644 --- a/src/evo/deterministicmns.h +++ b/src/evo/deterministicmns.h @@ -39,7 +39,7 @@ class CDeterministicMNState uint256 confirmedHashWithProRegTxHash; CKeyID keyIDOwner; - CKeyID keyIDOperator; + CKeyID pubKeyOperator; CKeyID keyIDVoting; CService addr; CScript scriptPayout; @@ -50,7 +50,7 @@ class CDeterministicMNState explicit CDeterministicMNState(const ProRegPL& pl) { keyIDOwner = pl.keyIDOwner; - keyIDOperator = pl.keyIDOperator; + pubKeyOperator = pl.pubKeyOperator; keyIDVoting = pl.keyIDVoting; addr = pl.addr; scriptPayout = pl.scriptPayout; @@ -70,7 +70,7 @@ class CDeterministicMNState READWRITE(obj.confirmedHash); READWRITE(obj.confirmedHashWithProRegTxHash); READWRITE(obj.keyIDOwner); - READWRITE(obj.keyIDOperator); + READWRITE(obj.pubKeyOperator); READWRITE(obj.keyIDVoting); READWRITE(obj.addr); READWRITE(obj.scriptPayout); @@ -79,7 +79,7 @@ class CDeterministicMNState void ResetOperatorFields() { - keyIDOperator = CKeyID(); + pubKeyOperator = CKeyID(); addr = CService(); scriptOperatorPayout = CScript(); nRevocationReason = ProUpRevPL::REASON_NOT_SPECIFIED; @@ -119,7 +119,7 @@ class CDeterministicMNStateDiff Field_confirmedHash = 0x0040, Field_confirmedHashWithProRegTxHash = 0x0080, Field_keyIDOwner = 0x0100, - Field_keyIDOperator = 0x0200, + Field_pubKeyOperator = 0x0200, Field_keyIDVoting = 0x0400, Field_addr = 0x0800, Field_scriptPayout = 0x1000, @@ -136,7 +136,7 @@ class CDeterministicMNStateDiff DMN_STATE_DIFF_LINE(confirmedHash) \ DMN_STATE_DIFF_LINE(confirmedHashWithProRegTxHash) \ DMN_STATE_DIFF_LINE(keyIDOwner) \ - DMN_STATE_DIFF_LINE(keyIDOperator) \ + DMN_STATE_DIFF_LINE(pubKeyOperator) \ DMN_STATE_DIFF_LINE(keyIDVoting) \ DMN_STATE_DIFF_LINE(addr) \ DMN_STATE_DIFF_LINE(scriptPayout) \ diff --git a/src/evo/providertx.cpp b/src/evo/providertx.cpp index 5016b403846d9..d5e0dfa00bf12 100644 --- a/src/evo/providertx.cpp +++ b/src/evo/providertx.cpp @@ -84,7 +84,7 @@ static bool CheckCollateralOut(const CTxOut& out, const ProRegPL& pl, CValidatio // this check applies to internal and external collateral, but internal collaterals are not necessarely a P2PKH if (collateralDestRet == CTxDestination(pl.keyIDOwner) || collateralDestRet == CTxDestination(pl.keyIDVoting) || - collateralDestRet == CTxDestination(pl.keyIDOperator)) { + collateralDestRet == CTxDestination(pl.pubKeyOperator)) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-collateral-reuse"); } // check collateral amount @@ -113,7 +113,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid return state.DoS(100, false, REJECT_INVALID, "bad-protx-mode"); } - if (pl.keyIDOwner.IsNull() || pl.keyIDOperator.IsNull() || pl.keyIDVoting.IsNull()) { + if (pl.keyIDOwner.IsNull() || pl.pubKeyOperator.IsNull() || pl.keyIDVoting.IsNull()) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-key-null"); } // we may support other kinds of scripts later, but restrict it for now @@ -132,7 +132,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid // don't allow reuse of payout key for other keys (don't allow people to put the payee key onto an online server) if (payoutDest == CTxDestination(pl.keyIDOwner) || payoutDest == CTxDestination(pl.keyIDVoting) || - payoutDest == CTxDestination(pl.keyIDOperator)) { + payoutDest == CTxDestination(pl.pubKeyOperator)) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-payee-reuse"); } @@ -202,7 +202,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid if (mnList.HasUniqueProperty(pl.keyIDOwner)) { return state.DoS(10, false, REJECT_DUPLICATE, "bad-protx-dup-owner-key"); } - if (mnList.HasUniqueProperty(pl.keyIDOperator)) { + if (mnList.HasUniqueProperty(pl.pubKeyOperator)) { return state.DoS(10, false, REJECT_DUPLICATE, "bad-protx-dup-operator-key"); } } @@ -230,8 +230,8 @@ std::string ProRegPL::ToString() const CTxDestination dest; std::string payee = ExtractDestination(scriptPayout, dest) ? EncodeDestination(dest) : "unknown"; - return strprintf("ProRegPL(nVersion=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, operatorAddress=%s, votingAddress=%s, scriptPayout=%s)", - nVersion, collateralOutpoint.ToStringShort(), addr.ToString(), (double)nOperatorReward / 100, EncodeDestination(keyIDOwner), EncodeDestination(keyIDOperator), EncodeDestination(keyIDVoting), payee); + return strprintf("ProRegPL(nVersion=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, operatorPubKey=%s, votingAddress=%s, scriptPayout=%s)", + nVersion, collateralOutpoint.ToStringShort(), addr.ToString(), (double)nOperatorReward / 100, EncodeDestination(keyIDOwner), EncodeDestination(pubKeyOperator), EncodeDestination(keyIDVoting), payee); } void ProRegPL::ToJson(UniValue& obj) const @@ -243,7 +243,7 @@ void ProRegPL::ToJson(UniValue& obj) const obj.pushKV("collateralIndex", (int)collateralOutpoint.n); obj.pushKV("service", addr.ToString()); obj.pushKV("ownerAddress", EncodeDestination(keyIDOwner)); - obj.pushKV("operatorAddress", EncodeDestination(keyIDOperator)); + obj.pushKV("operatorPubKey", EncodeDestination(pubKeyOperator)); obj.pushKV("votingAddress", EncodeDestination(keyIDVoting)); CTxDestination dest1; @@ -307,7 +307,7 @@ bool CheckProUpServTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVa } // we can only check the signature if pindexPrev != nullptr and the MN is known - if (!CheckHashSig(pl, mn->pdmnState->keyIDOperator, state)) { + if (!CheckHashSig(pl, mn->pdmnState->pubKeyOperator, state)) { // pass the state returned by the function above return false; } @@ -357,7 +357,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal return state.DoS(100, false, REJECT_INVALID, "bad-protx-mode"); } - if (pl.keyIDOperator.IsNull()) { + if (pl.pubKeyOperator.IsNull()) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-operator-key-null"); } if (pl.keyIDVoting.IsNull()) { @@ -375,7 +375,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal } // don't allow reuse of payee key for other keys - if (payoutDest == CTxDestination(pl.keyIDVoting) || payoutDest == CTxDestination(pl.keyIDOperator)) { + if (payoutDest == CTxDestination(pl.keyIDVoting) || payoutDest == CTxDestination(pl.pubKeyOperator)) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-payee-reuse"); } @@ -414,12 +414,12 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal } if (collateralTxDest == CTxDestination(dmn->pdmnState->keyIDOwner) || collateralTxDest == CTxDestination(pl.keyIDVoting) || - collateralTxDest == CTxDestination(pl.keyIDOperator)) { + collateralTxDest == CTxDestination(pl.pubKeyOperator)) { return state.DoS(10, false, REJECT_INVALID, "bad-protx-collateral-reuse"); } - if (mnList.HasUniqueProperty(pl.keyIDOperator)) { - auto otherDmn = mnList.GetUniquePropertyMN(pl.keyIDOperator); + if (mnList.HasUniqueProperty(pl.pubKeyOperator)) { + auto otherDmn = mnList.GetUniquePropertyMN(pl.pubKeyOperator); if (pl.proTxHash != otherDmn->proTxHash) { return state.DoS(10, false, REJECT_DUPLICATE, "bad-protx-dup-key"); } @@ -440,8 +440,8 @@ std::string ProUpRegPL::ToString() const CTxDestination dest; std::string payee = ExtractDestination(scriptPayout, dest) ? EncodeDestination(dest) : "unknown"; - return strprintf("ProUpRegPL(nVersion=%d, proTxHash=%s, operatorAddress=%s, votingAddress=%s, payoutAddress=%s)", - nVersion, proTxHash.ToString(), EncodeDestination(keyIDOperator), EncodeDestination(keyIDVoting), payee); + return strprintf("ProUpRegPL(nVersion=%d, proTxHash=%s, operatorPubKey=%s, votingAddress=%s, payoutAddress=%s)", + nVersion, proTxHash.ToString(), EncodeDestination(pubKeyOperator), EncodeDestination(keyIDVoting), payee); } void ProUpRegPL::ToJson(UniValue& obj) const @@ -455,7 +455,7 @@ void ProUpRegPL::ToJson(UniValue& obj) const if (ExtractDestination(scriptPayout, dest)) { obj.pushKV("payoutAddress", EncodeDestination(dest)); } - obj.pushKV("operatorAddress", EncodeDestination(keyIDOperator)); + obj.pushKV("operatorPubKey", EncodeDestination(pubKeyOperator)); obj.pushKV("inputsHash", inputsHash.ToString()); } @@ -491,7 +491,7 @@ bool CheckProUpRevTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal if (!dmn) return state.DoS(100, false, REJECT_INVALID, "bad-protx-hash"); - if (!CheckHashSig(pl, dmn->pdmnState->keyIDOperator, state)) { + if (!CheckHashSig(pl, dmn->pdmnState->pubKeyOperator, state)) { // pass the state returned by the function above return false; } diff --git a/src/evo/providertx.h b/src/evo/providertx.h index 058d0c81d9551..d7f1480af63b4 100644 --- a/src/evo/providertx.h +++ b/src/evo/providertx.h @@ -29,7 +29,7 @@ class ProRegPL COutPoint collateralOutpoint{UINT256_ZERO, (uint32_t)-1}; // if hash is null, we refer to a ProRegTx output CService addr; CKeyID keyIDOwner; - CKeyID keyIDOperator; + CKeyID pubKeyOperator; CKeyID keyIDVoting; CScript scriptPayout; uint16_t nOperatorReward{0}; @@ -47,7 +47,7 @@ class ProRegPL READWRITE(obj.collateralOutpoint); READWRITE(obj.addr); READWRITE(obj.keyIDOwner); - READWRITE(obj.keyIDOperator); + READWRITE(obj.pubKeyOperator); READWRITE(obj.keyIDVoting); READWRITE(obj.scriptPayout); READWRITE(obj.nOperatorReward); @@ -105,7 +105,7 @@ class ProUpRegPL uint16_t nVersion{CURRENT_VERSION}; // message version uint256 proTxHash; uint16_t nMode{0}; // only 0 supported for now - CKeyID keyIDOperator; + CKeyID pubKeyOperator; CKeyID keyIDVoting; CScript scriptPayout; uint256 inputsHash; // replay protection @@ -114,7 +114,7 @@ class ProUpRegPL public: SERIALIZE_METHODS(ProUpRegPL, obj) { - READWRITE(obj.nVersion, obj.proTxHash, obj.nMode, obj.keyIDOperator, obj.keyIDVoting, obj.scriptPayout, obj.inputsHash); + READWRITE(obj.nVersion, obj.proTxHash, obj.nMode, obj.pubKeyOperator, obj.keyIDVoting, obj.scriptPayout, obj.inputsHash); if (!(s.GetType() & SER_GETHASH)) { READWRITE(obj.vchSig); } diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index e98249afff8e9..d02ef11ba6e86 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -479,7 +479,7 @@ void CMasternodePayments::ProcessMessageMasternodePayments(CNode* pfrom, std::st auto dmn = mnList.GetMNByCollateral(winner.vinMasternode.prevout); if (dmn) { fDeterministic = true; - mnKeyID = Optional(dmn->pdmnState->keyIDOperator); + mnKeyID = Optional(dmn->pdmnState->pubKeyOperator); } else { const CMasternode* pmn = mnodeman.Find(winner.vinMasternode.prevout); if (pmn) { diff --git a/src/rpc/budget.cpp b/src/rpc/budget.cpp index 8b235608e50f5..1bf9c310068bf 100644 --- a/src/rpc/budget.cpp +++ b/src/rpc/budget.cpp @@ -379,7 +379,7 @@ static mnKeyList getDMNKeys(CWallet* const pwallet, const Optional& mnList.ForEachMN(true, [&](const CDeterministicMNCPtr& dmn) { bool filtered = mnFilter && dmn->proTxHash == mnFilter->proTxHash; if (!mnFilter || filtered) { - const CKeyID& mnKeyID = fFinal ? dmn->pdmnState->keyIDOperator : dmn->pdmnState->keyIDVoting; + const CKeyID& mnKeyID = fFinal ? dmn->pdmnState->pubKeyOperator : dmn->pdmnState->keyIDVoting; CKey mnKey; if (pwallet->GetKey(mnKeyID, mnKey)) { mnKeys.emplace_back(dmn->proTxHash.ToString(), &dmn->collateralOutpoint, mnKey); diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 1e8602bf8a9f3..040beb8f76eca 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -132,7 +132,7 @@ static inline bool filterMasternode(const UniValue& dmno, const std::string& str || (filter(dmno["collateralHash"].get_str(), strFilter)) || (filter(dmno["collateralAddress"].get_str(), strFilter)) || (filter(dmno["dmnstate"]["ownerAddress"].get_str(), strFilter)) - || (filter(dmno["dmnstate"]["operatorAddress"].get_str(), strFilter)) + || (filter(dmno["dmnstate"]["operatorPubKey"].get_str(), strFilter)) || (filter(dmno["dmnstate"]["votingAddress"].get_str(), strFilter)); } @@ -703,7 +703,7 @@ UniValue getmasternodestatus(const JSONRPCRequest& request) } const CActiveMasternodeInfo* amninfo = activeMasternodeManager->GetInfo(); UniValue mnObj(UniValue::VOBJ); - auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByOperatorKey(amninfo->keyIDOperator); + auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByOperatorKey(amninfo->pubKeyOperator); if (dmn) { dmn->ToJson(mnObj); } diff --git a/src/rpc/rpcevo.cpp b/src/rpc/rpcevo.cpp index 7ba0885d49adf..204d7e7a8b1bb 100644 --- a/src/rpc/rpcevo.cpp +++ b/src/rpc/rpcevo.cpp @@ -35,8 +35,8 @@ enum ProRegParam { collateralIndex, ipAndPort_register, ipAndPort_update, - operatorAddress_register, - operatorAddress_update, + operatorPubKey_register, + operatorPubKey_update, operatorPayoutAddress_register, operatorPayoutAddress_update, operatorReward, @@ -69,12 +69,12 @@ static const std::map mapParamHelp = { "%d. \"ipAndPort\" (string, required) IP and port in the form \"IP:PORT\".\n" " If set to an empty string, the currently active ip is reused.\n" }, - {operatorAddress_register, - "%d. \"operatorAddress\" (string, required) The operator key address. The private key does not have to be known by your wallet.\n" + {operatorPubKey_register, + "%d. \"operatorPubKey\" (string, required) The operator key address. The private key does not have to be known by your wallet.\n" " If set to an empty string, ownerAddr will be used.\n" }, - {operatorAddress_update, - "%d. \"operatorAddress\" (string, required) The operator key address. The private key does not have to be known by your wallet.\n" + {operatorPubKey_update, + "%d. \"operatorPubKey\" (string, required) The operator key address. The private key does not have to be known by your wallet.\n" " It has to match the private key which can be used later to update the service.\n" " If set to an empty string, the currently active operator key is reused.\n" }, @@ -85,7 +85,7 @@ static const std::map mapParamHelp = { {operatorPayoutAddress_register, "%d. \"operatorPayoutAddress\" (string, optional) The address used for operator reward payments.\n" " Only allowed when the ProRegTx had a non-zero operatorReward value.\n" - " If set to an empty string, the operatorAddress is used.\n" + " If set to an empty string, the operatorPubKey is used.\n" }, {operatorPayoutAddress_update, "%d. \"operatorPayoutAddress\" (string, optional) The address used for operator reward payments.\n" @@ -340,9 +340,9 @@ static ProRegPL ParseProRegPLParams(const UniValue& params, unsigned int paramId const std::string& strAddOperator = params[paramIdx + 2].get_str(); const std::string& strAddVoting = params[paramIdx + 3].get_str(); pl.keyIDOwner = ParsePubKeyIDFromAddress(strAddOwner); - pl.keyIDOperator = pl.keyIDOwner; + pl.pubKeyOperator = pl.keyIDOwner; if (!strAddOperator.empty()) { - pl.keyIDOperator = ParsePubKeyIDFromAddress(strAddOperator); + pl.pubKeyOperator = ParsePubKeyIDFromAddress(strAddOperator); } pl.keyIDVoting = pl.keyIDOwner; if (!strAddVoting.empty()) { @@ -388,11 +388,11 @@ static UniValue ProTxRegister(const JSONRPCRequest& request, bool fSignAndSend) if (request.fHelp || request.params.size() < 7 || request.params.size() > 9) { throw std::runtime_error( (fSignAndSend ? - "protx_register \"collateralHash\" collateralIndex \"ipAndPort\" \"ownerAddress\" \"operatorAddress\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" + "protx_register \"collateralHash\" collateralIndex \"ipAndPort\" \"ownerAddress\" \"operatorPubKey\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" "The collateral is specified through \"collateralHash\" and \"collateralIndex\" and must be an unspent\n" "transaction output spendable by this wallet. It must also not be used by any other masternode.\n" : - "protx_register_prepare \"collateralHash\" collateralIndex \"ipAndPort\" \"ownerAddress\" \"operatorAddress\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" + "protx_register_prepare \"collateralHash\" collateralIndex \"ipAndPort\" \"ownerAddress\" \"operatorPubKey\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" "\nCreates an unsigned ProTx and returns it. The ProTx must be signed externally with the collateral\n" "key and then passed to \"protx_register_submit\".\n" "The collateral is specified through \"collateralHash\" and \"collateralIndex\" and must be an unspent transaction output.\n" @@ -403,7 +403,7 @@ static UniValue ProTxRegister(const JSONRPCRequest& request, bool fSignAndSend) + GetHelpString(2, collateralIndex) + GetHelpString(3, ipAndPort_register) + GetHelpString(4, ownerAddress) - + GetHelpString(5, operatorAddress_register) + + GetHelpString(5, operatorPubKey_register) + GetHelpString(6, votingAddress_register) + GetHelpString(7, payoutAddress_register) + GetHelpString(8, operatorReward) @@ -557,7 +557,7 @@ UniValue protx_register_fund(const JSONRPCRequest& request) if (request.fHelp || request.params.size() < 6 || request.params.size() > 8) { throw std::runtime_error( - "protx_register_fund \"collateralAddress\" \"ipAndPort\" \"ownerAddress\" \"operatorAddress\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" + "protx_register_fund \"collateralAddress\" \"ipAndPort\" \"ownerAddress\" \"operatorPubKey\" \"votingAddress\" \"payoutAddress\" (operatorReward \"operatorPayoutAddress\")\n" "\nCreates, funds and sends a ProTx to the network. The resulting transaction will move 10000 PIV\n" "to the address specified by collateralAddress and will then function as masternode collateral.\n" + HelpRequiringPassphrase(pwallet) + "\n" @@ -565,7 +565,7 @@ UniValue protx_register_fund(const JSONRPCRequest& request) + GetHelpString(1, collateralAddress) + GetHelpString(2, ipAndPort_register) + GetHelpString(3, ownerAddress) - + GetHelpString(4, operatorAddress_register) + + GetHelpString(4, operatorPubKey_register) + GetHelpString(5, votingAddress_register) + GetHelpString(6, payoutAddress_register) + GetHelpString(7, operatorReward) @@ -662,7 +662,7 @@ static void AddDMNEntryToList(UniValue& ret, CWallet* pwallet, const CDeterminis if (pwallet && !skipWalletCheck) { LOCK(pwallet->cs_wallet); hasOwnerKey = pwallet->HaveKey(dmn->pdmnState->keyIDOwner); - hasOperatorKey = pwallet->HaveKey(dmn->pdmnState->keyIDOperator); + hasOperatorKey = pwallet->HaveKey(dmn->pdmnState->pubKeyOperator); hasVotingKey = pwallet->HaveKey(dmn->pdmnState->keyIDVoting); ownsPayeeScript = CheckWalletOwnsScript(pwallet, dmn->pdmnState->scriptPayout); CTransactionRef collTx; @@ -819,7 +819,7 @@ UniValue protx_update_service(const JSONRPCRequest& request) } const std::string& strOpKey = request.params.size() > 3 ? request.params[3].get_str() : ""; - const CKey& operatorKey = strOpKey.empty() ? GetKeyFromWallet(pwallet, dmn->pdmnState->keyIDOperator) + const CKey& operatorKey = strOpKey.empty() ? GetKeyFromWallet(pwallet, dmn->pdmnState->pubKeyOperator) : ParsePrivKey(pwallet, strOpKey, false); CMutableTransaction tx; @@ -843,14 +843,14 @@ UniValue protx_update_registrar(const JSONRPCRequest& request) if (request.fHelp || request.params.size() < 4 || request.params.size() > 5) { throw std::runtime_error( - "protx update_registrar \"proTxHash\" \"operatorAddress\" \"votingAddress\" \"payoutAddress\" (\"ownerKey\")\n" + "protx update_registrar \"proTxHash\" \"operatorPubKey\" \"votingAddress\" \"payoutAddress\" (\"ownerKey\")\n" "\nCreates and sends a ProUpRegTx to the network. This will update the operator key, voting key and payout\n" "address of the masternode specified by \"proTxHash\".\n" "The owner key of this masternode must be known to your wallet.\n" + HelpRequiringPassphrase(pwallet) + "\n" "\nArguments:\n" + GetHelpString(1, proTxHash) - + GetHelpString(2, operatorAddress_update) + + GetHelpString(2, operatorPubKey_update) + GetHelpString(3, votingAddress_update) + GetHelpString(4, payoutAddress_update) + GetHelpString(5, ownerKey) + @@ -880,7 +880,7 @@ UniValue protx_update_registrar(const JSONRPCRequest& request) throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("masternode with hash %s not found", pl.proTxHash.ToString())); } const std::string& strOperatorAddress = request.params[1].get_str(); - pl.keyIDOperator = strOperatorAddress.empty() ? dmn->pdmnState->keyIDOperator + pl.pubKeyOperator = strOperatorAddress.empty() ? dmn->pdmnState->pubKeyOperator : ParsePubKeyIDFromAddress(strOperatorAddress); const std::string& strVotingAddress = request.params[2].get_str(); @@ -950,7 +950,7 @@ UniValue protx_revoke(const JSONRPCRequest& request) } const std::string& strOpKey = request.params.size() > 1 ? request.params[1].get_str() : ""; - const CKey& operatorKey = strOpKey.empty() ? GetKeyFromWallet(pwallet, dmn->pdmnState->keyIDOperator) + const CKey& operatorKey = strOpKey.empty() ? GetKeyFromWallet(pwallet, dmn->pdmnState->pubKeyOperator) : ParsePrivKey(pwallet, strOpKey, false); pl.nReason = ProUpRevPL::RevocationReason::REASON_NOT_SPECIFIED; @@ -981,12 +981,12 @@ static const CRPCCommand commands[] = // -------------- --------------------------------- ------------------------ ------ -------- { "evo", "protx_list", &protx_list, true, {"detailed","wallet_only","valid_only","height"} }, #ifdef ENABLE_WALLET - { "evo", "protx_register", &protx_register, true, {"collateralHash","collateralIndex","ipAndPort","ownerAddress","operatorAddress","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, - { "evo", "protx_register_fund", &protx_register_fund, true, {"collateralAddress","ipAndPort","ownerAddress","operatorAddress","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, - { "evo", "protx_register_prepare", &protx_register_prepare, true, {"collateralHash","collateralIndex","ipAndPort","ownerAddress","operatorAddress","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, + { "evo", "protx_register", &protx_register, true, {"collateralHash","collateralIndex","ipAndPort","ownerAddress","operatorPubKey","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, + { "evo", "protx_register_fund", &protx_register_fund, true, {"collateralAddress","ipAndPort","ownerAddress","operatorPubKey","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, + { "evo", "protx_register_prepare", &protx_register_prepare, true, {"collateralHash","collateralIndex","ipAndPort","ownerAddress","operatorPubKey","votingAddress","payoutAddress","operatorReward","operatorPayoutAddress"} }, { "evo", "protx_register_submit", &protx_register_submit, true, {"tx","sig"} }, { "evo", "protx_revoke", &protx_revoke, true, {"proTxHash","operatorKey","reason"} }, - { "evo", "protx_update_registrar", &protx_update_registrar, true, {"proTxHash","operatorAddress","votingAddress","payoutAddress","ownerKey"} }, + { "evo", "protx_update_registrar", &protx_update_registrar, true, {"proTxHash","operatorPubKey","votingAddress","payoutAddress","ownerKey"} }, { "evo", "protx_update_service", &protx_update_service, true, {"proTxHash","ipAndPort","operatorPayoutAddress","operatorKey"} }, #endif //ENABLE_WALLET }; diff --git a/src/test/evo_deterministicmns_tests.cpp b/src/test/evo_deterministicmns_tests.cpp index 3628664f7ae7f..b14cef3429e8d 100644 --- a/src/test/evo_deterministicmns_tests.cpp +++ b/src/test/evo_deterministicmns_tests.cpp @@ -114,7 +114,7 @@ static CMutableTransaction CreateProRegTx(Optional optCollateralOut, pl.collateralOutpoint = (optCollateralOut ? *optCollateralOut : COutPoint(UINT256_ZERO, 0)); pl.addr = LookupNumeric("1.1.1.1", port); pl.keyIDOwner = ownerKey.GetPubKey().GetID(); - pl.keyIDOperator = operatorKey.GetPubKey().GetID(); + pl.pubKeyOperator = operatorKey.GetPubKey().GetID(); pl.keyIDVoting = ownerKey.GetPubKey().GetID(); pl.scriptPayout = scriptPayout; pl.nOperatorReward = operatorReward; @@ -163,7 +163,7 @@ static CMutableTransaction CreateProUpRegTx(SimpleUTXOMap& utxos, const uint256& ProUpRegPL pl; pl.proTxHash = proTxHash; - pl.keyIDOperator = operatorKey.GetPubKey().GetID(); + pl.pubKeyOperator = operatorKey.GetPubKey().GetID(); pl.keyIDVoting = votingKey.GetPubKey().GetID(); pl.scriptPayout = scriptPayout; @@ -641,7 +641,7 @@ BOOST_FIXTURE_TEST_CASE(dip3_protx, TestChain400Setup) SyncWithValidationInterfaceQueue(); auto dmn = deterministicMNManager->GetListAtChainTip().GetMN(proTx); BOOST_ASSERT(dmn != nullptr); - BOOST_CHECK_MESSAGE(dmn->pdmnState->keyIDOperator == new_operatorKey.GetPubKey().GetID(), "mn operator key not changed"); + BOOST_CHECK_MESSAGE(dmn->pdmnState->pubKeyOperator == new_operatorKey.GetPubKey().GetID(), "mn operator key not changed"); BOOST_CHECK_MESSAGE(dmn->pdmnState->keyIDVoting == new_votingKey.GetPubKey().GetID(), "mn voting key not changed"); BOOST_CHECK_MESSAGE(dmn->pdmnState->scriptPayout == new_payee, "mn script payout not changed"); @@ -778,7 +778,7 @@ BOOST_FIXTURE_TEST_CASE(dip3_protx, TestChain400Setup) SyncWithValidationInterfaceQueue(); auto dmn = deterministicMNManager->GetListAtChainTip().GetMN(proTx); BOOST_ASSERT(dmn != nullptr); - BOOST_CHECK_MESSAGE(dmn->pdmnState->keyIDOperator == CKeyID(), "mn operator key not removed"); + BOOST_CHECK_MESSAGE(dmn->pdmnState->pubKeyOperator == CKeyID(), "mn operator key not removed"); BOOST_CHECK_MESSAGE(dmn->pdmnState->addr == CService(), "mn IP address not removed"); BOOST_CHECK_MESSAGE(dmn->pdmnState->scriptOperatorPayout.empty(), "mn operator payout not removed"); BOOST_CHECK_EQUAL(dmn->pdmnState->nRevocationReason, reason); diff --git a/src/test/evo_specialtx_tests.cpp b/src/test/evo_specialtx_tests.cpp index 2a71c9e3bc06d..35866cea14681 100644 --- a/src/test/evo_specialtx_tests.cpp +++ b/src/test/evo_specialtx_tests.cpp @@ -37,7 +37,7 @@ static ProRegPL GetRandomProRegPayload() pl.collateralOutpoint.n = InsecureRandBits(2); BOOST_CHECK(Lookup("57.12.210.11:51472", pl.addr, Params().GetDefaultPort(), false)); pl.keyIDOwner = GetRandomKeyID(); - pl.keyIDOperator = GetRandomKeyID(); + pl.pubKeyOperator = GetRandomKeyID(); pl.keyIDVoting = GetRandomKeyID(); pl.scriptPayout = GetRandomScript(); pl.nOperatorReward = InsecureRandRange(10000); @@ -62,7 +62,7 @@ static ProUpRegPL GetRandomProUpRegPayload() { ProUpRegPL pl; pl.proTxHash = GetRandHash(); - pl.keyIDOperator = GetRandomKeyID(); + pl.pubKeyOperator = GetRandomKeyID(); pl.keyIDVoting = GetRandomKeyID(); pl.scriptPayout = GetRandomScript(); pl.inputsHash = GetRandHash(); @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(proreg_setpayload_test) BOOST_CHECK(pl.collateralOutpoint == pl2.collateralOutpoint); BOOST_CHECK(pl.addr == pl2.addr); BOOST_CHECK(pl.keyIDOwner == pl2.keyIDOwner); - BOOST_CHECK(pl.keyIDOperator == pl2.keyIDOperator); + BOOST_CHECK(pl.pubKeyOperator == pl2.pubKeyOperator); BOOST_CHECK(pl.keyIDVoting == pl2.keyIDVoting); BOOST_CHECK(pl.scriptPayout == pl2.scriptPayout); BOOST_CHECK(pl.nOperatorReward == pl2.nOperatorReward); @@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE(proupreg_setpayload_test) ProUpRegPL pl2; BOOST_CHECK(GetTxPayload(mtx, pl2)); BOOST_CHECK(pl.proTxHash == pl2.proTxHash); - BOOST_CHECK(pl.keyIDOperator == pl2.keyIDOperator); + BOOST_CHECK(pl.pubKeyOperator == pl2.pubKeyOperator); BOOST_CHECK(pl.keyIDVoting == pl2.keyIDVoting); BOOST_CHECK(pl.scriptPayout == pl2.scriptPayout); BOOST_CHECK(pl.inputsHash == pl2.inputsHash); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 0ceb050a98ba9..c0623bdae6cec 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -378,7 +378,7 @@ void CTxMemPool::addUncheckedSpecialTx(const CTransaction& tx) } mapProTxAddresses.emplace(pl.addr, txid); mapProTxPubKeyIDs.emplace(pl.keyIDOwner, txid); - mapProTxPubKeyIDs.emplace(pl.keyIDOperator, txid); + mapProTxPubKeyIDs.emplace(pl.pubKeyOperator, txid); break; } @@ -396,7 +396,7 @@ void CTxMemPool::addUncheckedSpecialTx(const CTransaction& tx) bool ok = GetTxPayload(tx, pl); assert(ok); mapProTxRefs.emplace(pl.proTxHash, txid); - mapProTxPubKeyIDs.emplace(pl.keyIDOperator, tx.GetHash()); + mapProTxPubKeyIDs.emplace(pl.pubKeyOperator, tx.GetHash()); break; } @@ -503,7 +503,7 @@ void CTxMemPool::removeUncheckedSpecialTx(const CTransaction& tx) mapProTxCollaterals.erase(pl.collateralOutpoint); mapProTxAddresses.erase(pl.addr); mapProTxPubKeyIDs.erase(pl.keyIDOwner); - mapProTxPubKeyIDs.erase(pl.keyIDOperator); + mapProTxPubKeyIDs.erase(pl.pubKeyOperator); break; } @@ -521,7 +521,7 @@ void CTxMemPool::removeUncheckedSpecialTx(const CTransaction& tx) bool ok = GetTxPayload(tx, pl); assert(ok); eraseProTxRef(pl.proTxHash, txid); - mapProTxPubKeyIDs.erase(pl.keyIDOperator); + mapProTxPubKeyIDs.erase(pl.pubKeyOperator); break; } @@ -792,7 +792,7 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx) } } removeProTxPubKeyConflicts(tx, pl.keyIDOwner); - removeProTxPubKeyConflicts(tx, pl.keyIDOperator); + removeProTxPubKeyConflicts(tx, pl.pubKeyOperator); if (!pl.collateralOutpoint.hash.IsNull()) { removeProTxCollateralConflicts(tx, pl.collateralOutpoint); } @@ -820,7 +820,7 @@ void CTxMemPool::removeProTxConflicts(const CTransaction &tx) LogPrint(BCLog::MEMPOOL, "%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); return; } - removeProTxPubKeyConflicts(tx, pl.keyIDOperator); + removeProTxPubKeyConflicts(tx, pl.pubKeyOperator); break; } @@ -1153,7 +1153,7 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const LogPrint(BCLog::MEMPOOL, "%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); return true; // i.e. can't decode payload == conflict } - if (mapProTxAddresses.count(pl.addr) || mapProTxPubKeyIDs.count(pl.keyIDOwner) || mapProTxPubKeyIDs.count(pl.keyIDOperator)) { + if (mapProTxAddresses.count(pl.addr) || mapProTxPubKeyIDs.count(pl.keyIDOwner) || mapProTxPubKeyIDs.count(pl.pubKeyOperator)) { return true; } if (!pl.collateralOutpoint.hash.IsNull()) { @@ -1185,7 +1185,7 @@ bool CTxMemPool::existsProviderTxConflict(const CTransaction &tx) const LogPrint(BCLog::MEMPOOL, "%s: ERROR: Invalid transaction payload, tx: %s", __func__, tx.ToString()); return true; // i.e. can't decode payload == conflict } - auto it = mapProTxPubKeyIDs.find(pl.keyIDOperator); + auto it = mapProTxPubKeyIDs.find(pl.pubKeyOperator); return it != mapProTxPubKeyIDs.end() && it->second != pl.proTxHash; }