Skip to content

Commit 694def5

Browse files
authored
Numeric prefix to all network upgrades (#2543)
1 parent 4ee95b3 commit 694def5

52 files changed

Lines changed: 486 additions & 486 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

contrib/devtools/mocknet.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ index 1ad8d066d..01b13b8aa 100644
1212
+ }
1313
+
1414
int nHeight{pindexLast->nHeight + 1};
15-
bool newDifficultyAdjust{nHeight > params.EunosHeight};
15+
bool newDifficultyAdjust{nHeight > params.DF8EunosHeight};
1616

1717
diff --git a/src/version.h b/src/version.h
1818
index 3ab303d56..fb84cea92 100644

src/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class CBlockIndex
330330
std::sort(pbegin, pend);
331331

332332
// Only after FC and when we have a full set of times.
333-
if (nHeight >= Params().GetConsensus().FortCanningHeight && pend - pbegin == nMedianTimeSpan) {
333+
if (nHeight >= Params().GetConsensus().DF11FortCanningHeight && pend - pbegin == nMedianTimeSpan) {
334334
// Take the median of the top five.
335335
return pbegin[8];
336336
}

src/chainparams.cpp

Lines changed: 126 additions & 126 deletions
Large diffs are not rendered by default.

src/consensus/params.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,32 @@ struct Params {
7676
* BIP 16 exception blocks. */
7777
int SegwitHeight;
7878
/** Block height at which tokens, liquidity pools and new block rewards becomes active */
79-
int AMKHeight;
79+
int DF1AMKHeight;
8080
/** What exactly? Changes to mint DAT, new updatetokens? */
81-
int BayfrontHeight;
82-
int BayfrontMarinaHeight;
81+
int DF2BayfrontHeight;
82+
int DF3DF4BayfrontGardensHeight;
8383
int BayfrontGardensHeight;
8484
/** Third major fork. */
85-
int ClarkeQuayHeight;
85+
int DF5ClarkeQuayHeight;
8686
/** Fourth major fork **/
87-
int DakotaHeight;
88-
int DakotaCrescentHeight;
87+
int DF6DakotaHeight;
88+
int DF7DakotaCrescentHeight;
8989
/** Fifth major fork **/
90-
int EunosHeight;
91-
int EunosKampungHeight;
92-
int EunosPayaHeight;
93-
int FortCanningHeight;
94-
int FortCanningMuseumHeight;
95-
int FortCanningParkHeight;
96-
int FortCanningHillHeight;
97-
int FortCanningRoadHeight;
98-
int FortCanningCrunchHeight;
99-
int FortCanningSpringHeight;
100-
int FortCanningGreatWorldHeight;
101-
int FortCanningEpilogueHeight;
102-
int GrandCentralHeight;
103-
int GrandCentralEpilogueHeight;
104-
int NextNetworkUpgradeHeight;
90+
int DF8EunosHeight;
91+
int DF9EunosKampungHeight;
92+
int DF10EunosPayaHeight;
93+
int DF11FortCanningHeight;
94+
int DF12FortCanningMuseumHeight;
95+
int DF13FortCanningParkHeight;
96+
int DF14FortCanningHillHeight;
97+
int DF15FortCanningRoadHeight;
98+
int DF16FortCanningCrunchHeight;
99+
int DF17FortCanningSpringHeight;
100+
int DF18FortCanningGreatWorldHeight;
101+
int DF19FortCanningEpilogueHeight;
102+
int DF20GrandCentralHeight;
103+
int DF21GrandCentralEpilogueHeight;
104+
int DF22NextHeight;
105105

106106
/** Foundation share after AMK, normalized to COIN = 100% */
107107
CAmount foundationShareDFIP1;

src/consensus/tx_verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, c
178178
std::vector<unsigned char> dummy;
179179
const auto txType = GuessCustomTxType(tx, dummy);
180180

181-
if (IsBelowDakotaMintTokenOrAccountToUtxos(txType, nSpendHeight) || (nSpendHeight >= chainparams.GetConsensus().GrandCentralHeight && txType == CustomTxType::UpdateMasternode)) {
181+
if (IsBelowDakotaMintTokenOrAccountToUtxos(txType, nSpendHeight) || (nSpendHeight >= chainparams.GetConsensus().DF20GrandCentralHeight && txType == CustomTxType::UpdateMasternode)) {
182182
CCustomCSView discardCache(mnview, nullptr, nullptr, nullptr);
183183
// Note: TXs are already filtered. So we pass isEVMEnabled to false, but for future proof, refactor this enough,
184184
// that it's propagated.

src/masternodes/anchors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,14 @@ bool ValidateAnchor(const CAnchor &anchor) {
759759
// Post-fork anchor, will be added to pending anchors to validate in chain context
760760
if (GetAnchorEmbeddedData(teamData, anchorCreationHeight, prefix)) {
761761
// Make sure anchor created after fork.
762-
if (anchorCreationHeight >= static_cast<uint64_t>(Params().GetConsensus().DakotaHeight)) {
762+
if (anchorCreationHeight >= static_cast<uint64_t>(Params().GetConsensus().DF6DakotaHeight)) {
763763
return true;
764764
} else {
765765
LogPrint(BCLog::ANCHORING,
766766
"%s: Post fork anchor created before fork height. Anchor %ld fork %d\n",
767767
__func__,
768768
anchorCreationHeight,
769-
Params().GetConsensus().DakotaHeight);
769+
Params().GetConsensus().DF6DakotaHeight);
770770
return false;
771771
}
772772
}
@@ -875,7 +875,7 @@ bool ContextualValidateAnchor(const CAnchorData &anchor, CBlockIndex &anchorBloc
875875
}
876876

877877
// Recreate deeper anchor depth
878-
if (anchorCreationHeight >= static_cast<uint64_t>(Params().GetConsensus().FortCanningHeight)) {
878+
if (anchorCreationHeight >= static_cast<uint64_t>(Params().GetConsensus().DF11FortCanningHeight)) {
879879
timeDepth += Params().GetConsensus().mn.anchoringAdditionalTimeDepth;
880880
while (anchorHeight > 0 && ::ChainActive()[anchorHeight]->nTime + timeDepth > anchorCreationBlock->nTime) {
881881
--anchorHeight;
@@ -1147,7 +1147,7 @@ const PendingOrderType PendingOrder =
11471147
PendingOrderType([](const CAnchorIndex::AnchorRec &a, const CAnchorIndex::AnchorRec &b) {
11481148
if (a.btcHeight == b.btcHeight) {
11491149
if (a.anchor.height == b.anchor.height) {
1150-
if (a.anchor.height >= static_cast<THeight>(Params().GetConsensus().EunosHeight)) {
1150+
if (a.anchor.height >= static_cast<THeight>(Params().GetConsensus().DF8EunosHeight)) {
11511151
const auto blockHash = panchors->ReadBlockHash(a.btcHeight);
11521152
auto aHash = Hash(a.txHash.begin(), a.txHash.end(), blockHash.begin(), blockHash.end());
11531153
auto bHash = Hash(b.txHash.begin(), b.txHash.end(), blockHash.begin(), blockHash.end());

src/masternodes/consensus/governance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Res CGovernanceConsensus::operator()(const CGovernanceHeightMessage &obj) const
153153
}
154154

155155
// Validate GovVariables before storing
156-
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) &&
156+
if (height >= static_cast<uint32_t>(consensus.DF16FortCanningCrunchHeight) &&
157157
obj.govVar->GetName() == "ATTRIBUTES") {
158158
auto govVar = mnview.GetAttributes();
159159
if (!govVar) {
@@ -173,7 +173,7 @@ Res CGovernanceConsensus::operator()(const CGovernanceHeightMessage &obj) const
173173
}
174174

175175
// After GW exclude TokenSplit if split will have already been performed by startHeight
176-
if (height >= static_cast<uint32_t>(consensus.GrandCentralHeight)) {
176+
if (height >= static_cast<uint32_t>(consensus.DF20GrandCentralHeight)) {
177177
if (const auto attrVar = std::dynamic_pointer_cast<ATTRIBUTES>(govVar); attrVar) {
178178
const auto attrMap = attrVar->GetAttributesMap();
179179
std::vector<CDataStructureV0> keysToErase;

src/masternodes/consensus/icxorders.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#include <masternodes/mn_checks.h>
1010

1111
bool 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)) {

src/masternodes/consensus/loans.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ static Res PaybackWithCollateral(CCustomCSView &view,
139139
}
140140

141141
bool CLoansConsensus::IsTokensMigratedToGovVar() const {
142-
return static_cast<int>(height) > consensus.FortCanningCrunchHeight + 1;
142+
return static_cast<int>(height) > consensus.DF16FortCanningCrunchHeight + 1;
143143
}
144144

145145
Res CLoansConsensus::operator()(const CLoanSetCollateralTokenMessage &obj) const {
146146
Require(CheckCustomTx());
147147

148148
Require(HasFoundationAuth(), "tx not from foundation member!");
149149

150-
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
150+
if (height >= static_cast<uint32_t>(consensus.DF16FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
151151
const auto &tokenId = obj.idToken.v;
152152

153153
auto attributes = mnview.GetAttributes();
@@ -214,7 +214,7 @@ Res CLoansConsensus::operator()(const CLoanSetLoanTokenMessage &obj) const {
214214

215215
Require(HasFoundationAuth(), "tx not from foundation member!");
216216

217-
if (height < static_cast<uint32_t>(consensus.FortCanningGreatWorldHeight)) {
217+
if (height < static_cast<uint32_t>(consensus.DF18FortCanningGreatWorldHeight)) {
218218
Require(obj.interest >= 0, "interest rate cannot be less than 0!");
219219
}
220220

@@ -234,7 +234,7 @@ Res CLoansConsensus::operator()(const CLoanSetLoanTokenMessage &obj) const {
234234
auto tokenId = mnview.CreateToken(token, false, isEvmEnabledForBlock, evmQueueId);
235235
Require(tokenId);
236236

237-
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
237+
if (height >= static_cast<uint32_t>(consensus.DF16FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
238238
const auto &id = tokenId.val->v;
239239

240240
auto attributes = mnview.GetAttributes();
@@ -292,15 +292,15 @@ Res CLoansConsensus::operator()(const CLoanUpdateLoanTokenMessage &obj) const {
292292

293293
Require(HasFoundationAuth(), "tx not from foundation member!");
294294

295-
if (height < static_cast<uint32_t>(consensus.FortCanningGreatWorldHeight)) {
295+
if (height < static_cast<uint32_t>(consensus.DF18FortCanningGreatWorldHeight)) {
296296
Require(obj.interest >= 0, "interest rate cannot be less than 0!");
297297
}
298298

299299
auto pair = mnview.GetTokenByCreationTx(obj.tokenTx);
300300
Require(pair, "Loan token (%s) does not exist!", obj.tokenTx.GetHex());
301301

302302
auto loanToken =
303-
(height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar())
303+
(height >= static_cast<uint32_t>(consensus.DF16FortCanningCrunchHeight) && IsTokensMigratedToGovVar())
304304
? mnview.GetLoanTokenByID(pair->first)
305305
: mnview.GetLoanToken(obj.tokenTx);
306306

@@ -323,7 +323,7 @@ Res CLoansConsensus::operator()(const CLoanUpdateLoanTokenMessage &obj) const {
323323

324324
Require(mnview.UpdateToken(pair->second));
325325

326-
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
326+
if (height >= static_cast<uint32_t>(consensus.DF16FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) {
327327
const auto &id = pair->first.v;
328328

329329
auto attributes = mnview.GetAttributes();
@@ -495,13 +495,13 @@ Res CLoansConsensus::operator()(const CLoanTakeLoanMessage &obj) const {
495495
auto hasDUSDLoans = false;
496496

497497
std::optional<std::pair<DCT_ID, std::optional<CTokensView::CTokenImpl> > > tokenDUSD;
498-
if (static_cast<int>(height) >= consensus.FortCanningRoadHeight) {
498+
if (static_cast<int>(height) >= consensus.DF15FortCanningRoadHeight) {
499499
tokenDUSD = mnview.GetToken("DUSD");
500500
}
501501

502502
uint64_t totalLoansActivePrice = 0, totalLoansNextPrice = 0;
503503
for (const auto &[tokenId, tokenAmount] : obj.amounts.balances) {
504-
if (height >= static_cast<uint32_t>(consensus.FortCanningGreatWorldHeight)) {
504+
if (height >= static_cast<uint32_t>(consensus.DF18FortCanningGreatWorldHeight)) {
505505
Require(tokenAmount > 0, "Valid loan amount required (input: %d@%d)", tokenAmount, tokenId.v);
506506
}
507507

@@ -654,12 +654,12 @@ Res CLoansConsensus::operator()(const CLoanPaybackLoanV2Message &obj) const {
654654

655655
if (!HasAuth(obj.from)) return DeFiErrors::TXMissingInput();
656656

657-
if (static_cast<int>(height) < consensus.FortCanningRoadHeight) {
657+
if (static_cast<int>(height) < consensus.DF15FortCanningRoadHeight) {
658658
if (!IsVaultPriceValid(mnview, obj.vaultId, height)) return DeFiErrors::LoanAssetPriceInvalid();
659659
}
660660

661661
// Handle payback with collateral special case
662-
if (static_cast<int>(height) >= consensus.FortCanningEpilogueHeight &&
662+
if (static_cast<int>(height) >= consensus.DF19FortCanningEpilogueHeight &&
663663
IsPaybackWithCollateral(mnview, obj.loans)) {
664664
return PaybackWithCollateral(mnview, *vault, obj.vaultId, height, time);
665665
}
@@ -676,7 +676,7 @@ Res CLoansConsensus::operator()(const CLoanPaybackLoanV2Message &obj) const {
676676
const auto &paybackTokenId = kv.first;
677677
auto paybackAmount = kv.second;
678678

679-
if (height >= static_cast<uint32_t>(consensus.FortCanningGreatWorldHeight)) {
679+
if (height >= static_cast<uint32_t>(consensus.DF18FortCanningGreatWorldHeight)) {
680680
if (paybackAmount <= 0) return DeFiErrors::LoanPaymentAmountInvalid(paybackAmount, paybackTokenId.v);
681681
}
682682

@@ -793,8 +793,8 @@ Res CLoansConsensus::operator()(const CLoanPaybackLoanV2Message &obj) const {
793793
if (!res)
794794
return res;
795795

796-
if (height >= static_cast<uint32_t>(consensus.FortCanningMuseumHeight) && subLoan < currentLoanAmount &&
797-
height < static_cast<uint32_t>(consensus.FortCanningGreatWorldHeight)) {
796+
if (height >= static_cast<uint32_t>(consensus.DF12FortCanningMuseumHeight) && subLoan < currentLoanAmount &&
797+
height < static_cast<uint32_t>(consensus.DF18FortCanningGreatWorldHeight)) {
798798
auto newRate = mnview.GetInterestRate(obj.vaultId, loanTokenId, height);
799799
if (!newRate) return DeFiErrors::TokenInterestRateInvalid(loanToken->symbol);
800800

@@ -812,7 +812,7 @@ Res CLoansConsensus::operator()(const CLoanPaybackLoanV2Message &obj) const {
812812
return res;
813813

814814
// If interest was negative remove it from sub amount
815-
if (height >= static_cast<uint32_t>(consensus.FortCanningEpilogueHeight) && subInterest < 0)
815+
if (height >= static_cast<uint32_t>(consensus.DF19FortCanningEpilogueHeight) && subInterest < 0)
816816
subLoan += subInterest;
817817

818818
// Do not sub balance if negative interest fully negates the current loan amount

0 commit comments

Comments
 (0)