99#include < masternodes/mn_checks.h>
1010
1111bool IsICXEnabled (const int height, const CCustomCSView &view, const Consensus::Params &consensus) {
12- if (height >= consensus.NextNetworkUpgradeHeight ) {
12+ if (height >= consensus.DF22NextHeight ) {
1313 const CDataStructureV0 enabledKey{AttributeTypes::Param, ParamIDs::Feature, DFIPKeys::ICXEnabled};
1414 auto attributes = view.GetAttributes ();
1515 assert (attributes);
1616 return attributes->GetValue (enabledKey, false );
1717 }
1818 // ICX transactions allowed before NextNetwrokUpgrade and some of these conditions
19- else if (height < consensus.FortCanningParkHeight || IsRegtestNetwork () || (IsTestNetwork () && static_cast <int >(height) >= 1250000 ))
19+ else if (height < consensus.DF13FortCanningParkHeight || IsRegtestNetwork () || (IsTestNetwork () && static_cast <int >(height) >= 1250000 ))
2020 return true ;
2121
2222 // ICX transactions disabled in all other cases
@@ -99,7 +99,7 @@ Res CICXOrdersConsensus::operator()(const CICXMakeOfferMessage &obj) const {
9999 auto order = mnview.GetICXOrderByCreationTx (makeoffer.orderTx );
100100 Require (order, " order with creation tx " + makeoffer.orderTx .GetHex () + " does not exists!" );
101101
102- auto expiry = static_cast <int >(height) < consensus.EunosPayaHeight ? CICXMakeOffer::DEFAULT_EXPIRY
102+ auto expiry = static_cast <int >(height) < consensus.DF10EunosPayaHeight ? CICXMakeOffer::DEFAULT_EXPIRY
103103 : CICXMakeOffer::EUNOSPAYA_DEFAULT_EXPIRY;
104104
105105 Require (makeoffer.expiry >= expiry, " offer expiry must be greater than %d!" , expiry - 1 );
@@ -156,7 +156,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitDFCHTLCMessage &obj) const {
156156 submitdfchtlc.offerTx .GetHex ());
157157
158158 uint32_t timeout;
159- if (static_cast <int >(height) < consensus.EunosPayaHeight )
159+ if (static_cast <int >(height) < consensus.DF10EunosPayaHeight )
160160 timeout = CICXSubmitDFCHTLC::MINIMUM_TIMEOUT;
161161 else
162162 timeout = CICXSubmitDFCHTLC::EUNOSPAYA_MINIMUM_TIMEOUT;
@@ -172,7 +172,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitDFCHTLCMessage &obj) const {
172172
173173 CAmount takerFee = offer->takerFee ;
174174 // EunosPaya: calculating adjusted takerFee only if amount in htlc different than in offer
175- if (static_cast <int >(height) >= consensus.EunosPayaHeight ) {
175+ if (static_cast <int >(height) >= consensus.DF10EunosPayaHeight ) {
176176 if (calcAmount < offer->amount ) {
177177 auto BTCAmount = MultiplyAmounts (submitdfchtlc.amount , order->orderPrice );
178178 takerFee = (arith_uint256 (BTCAmount) * offer->takerFee / offer->amount ).GetLow64 ();
@@ -221,7 +221,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitDFCHTLCMessage &obj) const {
221221 exthtlc->hash .GetHex ());
222222
223223 uint32_t timeout, btcBlocksInDfi;
224- if (static_cast <int >(height) < consensus.EunosPayaHeight ) {
224+ if (static_cast <int >(height) < consensus.DF10EunosPayaHeight ) {
225225 timeout = CICXSubmitDFCHTLC::MINIMUM_2ND_TIMEOUT;
226226 btcBlocksInDfi = CICXSubmitEXTHTLC::BTC_BLOCKS_IN_DFI_BLOCKS;
227227 } else {
@@ -279,7 +279,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitEXTHTLCMessage &obj) const {
279279 " Invalid hash, external htlc hash is different than dfc htlc hash" );
280280
281281 uint32_t timeout, btcBlocksInDfi;
282- if (static_cast <int >(height) < consensus.EunosPayaHeight ) {
282+ if (static_cast <int >(height) < consensus.DF10EunosPayaHeight ) {
283283 timeout = CICXSubmitEXTHTLC::MINIMUM_2ND_TIMEOUT;
284284 btcBlocksInDfi = CICXSubmitEXTHTLC::BTC_BLOCKS_IN_DFI_BLOCKS;
285285 } else {
@@ -298,7 +298,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitEXTHTLCMessage &obj) const {
298298 submitexthtlc.offerTx .GetHex ());
299299
300300 uint32_t timeout;
301- if (static_cast <int >(height) < consensus.EunosPayaHeight )
301+ if (static_cast <int >(height) < consensus.DF10EunosPayaHeight )
302302 timeout = CICXSubmitEXTHTLC::MINIMUM_TIMEOUT;
303303 else
304304 timeout = CICXSubmitEXTHTLC::EUNOSPAYA_MINIMUM_TIMEOUT;
@@ -312,7 +312,7 @@ Res CICXOrdersConsensus::operator()(const CICXSubmitEXTHTLCMessage &obj) const {
312312
313313 CAmount takerFee = offer->takerFee ;
314314 // EunosPaya: calculating adjusted takerFee only if amount in htlc different than in offer
315- if (static_cast <int >(height) >= consensus.EunosPayaHeight ) {
315+ if (static_cast <int >(height) >= consensus.DF10EunosPayaHeight ) {
316316 if (calcAmount < offer->amount ) {
317317 auto BTCAmount = DivideAmounts (offer->amount , order->orderPrice );
318318 takerFee = (arith_uint256 (submitexthtlc.amount ) * offer->takerFee / BTCAmount).GetLow64 ();
@@ -376,7 +376,7 @@ Res CICXOrdersConsensus::operator()(const CICXClaimDFCHTLCMessage &obj) const {
376376 Require (order, " order with creation tx %s does not exists!" , offer->orderTx .GetHex ());
377377
378378 auto exthtlc = mnview.HasICXSubmitEXTHTLCOpen (dfchtlc->offerTx );
379- if (static_cast <int >(height) < consensus.EunosPayaHeight )
379+ if (static_cast <int >(height) < consensus.DF10EunosPayaHeight )
380380 Require (exthtlc, " cannot claim, external htlc for this offer does not exists or expired!" );
381381
382382 // claim DFC HTLC to receiveAddress
@@ -402,7 +402,7 @@ Res CICXOrdersConsensus::operator()(const CICXClaimDFCHTLCMessage &obj) const {
402402 auto ICXBugPath = [&](uint32_t height) {
403403 if ((IsTestNetwork () && height >= 1250000 ) ||
404404 IsRegtestNetwork () ||
405- (IsMainNetwork () && height >= static_cast <uint32_t >(consensus.NextNetworkUpgradeHeight )))
405+ (IsMainNetwork () && height >= static_cast <uint32_t >(consensus.DF22NextHeight )))
406406 return false ;
407407 return true ;
408408 };
@@ -435,7 +435,7 @@ Res CICXOrdersConsensus::operator()(const CICXClaimDFCHTLCMessage &obj) const {
435435
436436 Require (mnview.ICXCloseDFCHTLC (*dfchtlc, CICXSubmitDFCHTLC::STATUS_CLAIMED));
437437
438- if (static_cast <int >(height) >= consensus.EunosPayaHeight ) {
438+ if (static_cast <int >(height) >= consensus.DF10EunosPayaHeight ) {
439439 if (exthtlc)
440440 return mnview.ICXCloseEXTHTLC (*exthtlc, CICXSubmitEXTHTLC::STATUS_CLOSED);
441441 else
@@ -504,7 +504,7 @@ Res CICXOrdersConsensus::operator()(const CICXCloseOfferMessage &obj) const {
504504 offer->closeTx = closeoffer.creationTx ;
505505 offer->closeHeight = closeoffer.creationHeight ;
506506
507- bool isPreEunosPaya = static_cast <int >(height) < consensus.EunosPayaHeight ;
507+ bool isPreEunosPaya = static_cast <int >(height) < consensus.DF10EunosPayaHeight ;
508508
509509 if (order->orderType == CICXOrder::TYPE_INTERNAL &&
510510 !mnview.ExistedICXSubmitDFCHTLC (offer->creationTx , isPreEunosPaya)) {
0 commit comments