@@ -84,7 +84,7 @@ static bool CheckCollateralOut(const CTxOut& out, const ProRegPL& pl, CValidatio
8484 // this check applies to internal and external collateral, but internal collaterals are not necessarely a P2PKH
8585 if (collateralDestRet == CTxDestination (pl.keyIDOwner ) ||
8686 collateralDestRet == CTxDestination (pl.keyIDVoting ) ||
87- collateralDestRet == CTxDestination (pl.keyIDOperator )) {
87+ collateralDestRet == CTxDestination (pl.pubKeyOperator )) {
8888 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-collateral-reuse" );
8989 }
9090 // check collateral amount
@@ -113,7 +113,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid
113113 return state.DoS (100 , false , REJECT_INVALID, " bad-protx-mode" );
114114 }
115115
116- if (pl.keyIDOwner .IsNull () || pl.keyIDOperator .IsNull () || pl.keyIDVoting .IsNull ()) {
116+ if (pl.keyIDOwner .IsNull () || pl.pubKeyOperator .IsNull () || pl.keyIDVoting .IsNull ()) {
117117 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-key-null" );
118118 }
119119 // 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
132132 // don't allow reuse of payout key for other keys (don't allow people to put the payee key onto an online server)
133133 if (payoutDest == CTxDestination (pl.keyIDOwner ) ||
134134 payoutDest == CTxDestination (pl.keyIDVoting ) ||
135- payoutDest == CTxDestination (pl.keyIDOperator )) {
135+ payoutDest == CTxDestination (pl.pubKeyOperator )) {
136136 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-payee-reuse" );
137137 }
138138
@@ -202,7 +202,7 @@ bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValid
202202 if (mnList.HasUniqueProperty (pl.keyIDOwner )) {
203203 return state.DoS (10 , false , REJECT_DUPLICATE, " bad-protx-dup-owner-key" );
204204 }
205- if (mnList.HasUniqueProperty (pl.keyIDOperator )) {
205+ if (mnList.HasUniqueProperty (pl.pubKeyOperator )) {
206206 return state.DoS (10 , false , REJECT_DUPLICATE, " bad-protx-dup-operator-key" );
207207 }
208208 }
@@ -230,8 +230,8 @@ std::string ProRegPL::ToString() const
230230 CTxDestination dest;
231231 std::string payee = ExtractDestination (scriptPayout, dest) ?
232232 EncodeDestination (dest) : " unknown" ;
233- return strprintf (" ProRegPL(nVersion=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, operatorAddress =%s, votingAddress=%s, scriptPayout=%s)" ,
234- nVersion, collateralOutpoint.ToStringShort (), addr.ToString (), (double )nOperatorReward / 100 , EncodeDestination (keyIDOwner), EncodeDestination (keyIDOperator ), EncodeDestination (keyIDVoting), payee);
233+ return strprintf (" ProRegPL(nVersion=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, operatorPubKey =%s, votingAddress=%s, scriptPayout=%s)" ,
234+ nVersion, collateralOutpoint.ToStringShort (), addr.ToString (), (double )nOperatorReward / 100 , EncodeDestination (keyIDOwner), EncodeDestination (pubKeyOperator ), EncodeDestination (keyIDVoting), payee);
235235}
236236
237237void ProRegPL::ToJson (UniValue& obj) const
@@ -243,7 +243,7 @@ void ProRegPL::ToJson(UniValue& obj) const
243243 obj.pushKV (" collateralIndex" , (int )collateralOutpoint.n );
244244 obj.pushKV (" service" , addr.ToString ());
245245 obj.pushKV (" ownerAddress" , EncodeDestination (keyIDOwner));
246- obj.pushKV (" operatorAddress " , EncodeDestination (keyIDOperator ));
246+ obj.pushKV (" operatorPubKey " , EncodeDestination (pubKeyOperator ));
247247 obj.pushKV (" votingAddress" , EncodeDestination (keyIDVoting));
248248
249249 CTxDestination dest1;
@@ -307,7 +307,7 @@ bool CheckProUpServTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVa
307307 }
308308
309309 // we can only check the signature if pindexPrev != nullptr and the MN is known
310- if (!CheckHashSig (pl, mn->pdmnState ->keyIDOperator , state)) {
310+ if (!CheckHashSig (pl, mn->pdmnState ->pubKeyOperator , state)) {
311311 // pass the state returned by the function above
312312 return false ;
313313 }
@@ -357,7 +357,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
357357 return state.DoS (100 , false , REJECT_INVALID, " bad-protx-mode" );
358358 }
359359
360- if (pl.keyIDOperator .IsNull ()) {
360+ if (pl.pubKeyOperator .IsNull ()) {
361361 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-operator-key-null" );
362362 }
363363 if (pl.keyIDVoting .IsNull ()) {
@@ -375,7 +375,7 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
375375 }
376376
377377 // don't allow reuse of payee key for other keys
378- if (payoutDest == CTxDestination (pl.keyIDVoting ) || payoutDest == CTxDestination (pl.keyIDOperator )) {
378+ if (payoutDest == CTxDestination (pl.keyIDVoting ) || payoutDest == CTxDestination (pl.pubKeyOperator )) {
379379 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-payee-reuse" );
380380 }
381381
@@ -414,12 +414,12 @@ bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
414414 }
415415 if (collateralTxDest == CTxDestination (dmn->pdmnState ->keyIDOwner ) ||
416416 collateralTxDest == CTxDestination (pl.keyIDVoting ) ||
417- collateralTxDest == CTxDestination (pl.keyIDOperator )) {
417+ collateralTxDest == CTxDestination (pl.pubKeyOperator )) {
418418 return state.DoS (10 , false , REJECT_INVALID, " bad-protx-collateral-reuse" );
419419 }
420420
421- if (mnList.HasUniqueProperty (pl.keyIDOperator )) {
422- auto otherDmn = mnList.GetUniquePropertyMN (pl.keyIDOperator );
421+ if (mnList.HasUniqueProperty (pl.pubKeyOperator )) {
422+ auto otherDmn = mnList.GetUniquePropertyMN (pl.pubKeyOperator );
423423 if (pl.proTxHash != otherDmn->proTxHash ) {
424424 return state.DoS (10 , false , REJECT_DUPLICATE, " bad-protx-dup-key" );
425425 }
@@ -440,8 +440,8 @@ std::string ProUpRegPL::ToString() const
440440 CTxDestination dest;
441441 std::string payee = ExtractDestination (scriptPayout, dest) ?
442442 EncodeDestination (dest) : " unknown" ;
443- return strprintf (" ProUpRegPL(nVersion=%d, proTxHash=%s, operatorAddress =%s, votingAddress=%s, payoutAddress=%s)" ,
444- nVersion, proTxHash.ToString (), EncodeDestination (keyIDOperator ), EncodeDestination (keyIDVoting), payee);
443+ return strprintf (" ProUpRegPL(nVersion=%d, proTxHash=%s, operatorPubKey =%s, votingAddress=%s, payoutAddress=%s)" ,
444+ nVersion, proTxHash.ToString (), EncodeDestination (pubKeyOperator ), EncodeDestination (keyIDVoting), payee);
445445}
446446
447447void ProUpRegPL::ToJson (UniValue& obj) const
@@ -455,7 +455,7 @@ void ProUpRegPL::ToJson(UniValue& obj) const
455455 if (ExtractDestination (scriptPayout, dest)) {
456456 obj.pushKV (" payoutAddress" , EncodeDestination (dest));
457457 }
458- obj.pushKV (" operatorAddress " , EncodeDestination (keyIDOperator ));
458+ obj.pushKV (" operatorPubKey " , EncodeDestination (pubKeyOperator ));
459459 obj.pushKV (" inputsHash" , inputsHash.ToString ());
460460}
461461
@@ -491,7 +491,7 @@ bool CheckProUpRevTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CVal
491491 if (!dmn)
492492 return state.DoS (100 , false , REJECT_INVALID, " bad-protx-hash" );
493493
494- if (!CheckHashSig (pl, dmn->pdmnState ->keyIDOperator , state)) {
494+ if (!CheckHashSig (pl, dmn->pdmnState ->pubKeyOperator , state)) {
495495 // pass the state returned by the function above
496496 return false ;
497497 }
0 commit comments