Skip to content

Commit

Permalink
Allow ICX fix on RegTest (#1479)
Browse files Browse the repository at this point in the history
* Fix ICX on RegTest

* Enable TXs on Regtest
  • Loading branch information
Bushstar authored Sep 16, 2022
1 parent 17c7d00 commit b5d203d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/masternodes/mn_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,8 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
// maker bonus only on fair dBTC/BTC (1:1) trades for now
DCT_ID BTC = FindTokenByPartialSymbolName(CICXOrder::TOKEN_BTC);
if (order->idToken == BTC && order->orderPrice == COIN) {
if (Params().NetworkIDString() == CBaseChainParams::TESTNET && height >= 1248000) {
if ((Params().NetworkIDString() == CBaseChainParams::TESTNET && height >= 1250000) ||
Params().NetworkIDString() == CBaseChainParams::REGTEST) {
res = TransferTokenBalance(DCT_ID{0}, offer->takerFee * 50 / 100, CScript(), order->ownerAddress);
} else {
res = TransferTokenBalance(BTC, offer->takerFee * 50 / 100, CScript(), order->ownerAddress);
Expand Down Expand Up @@ -3743,7 +3744,10 @@ bool IsDisabledTx(uint32_t height, CustomTxType type, const Consensus::Params& c
// ICXCloseOffer = '7',

// disable ICX orders for all networks other than testnet
if (Params().NetworkIDString() == CBaseChainParams::TESTNET && static_cast<int>(height) >= 1250000) return false;
if (Params().NetworkIDString() == CBaseChainParams::REGTEST ||
(Params().NetworkIDString() == CBaseChainParams::TESTNET && static_cast<int>(height) >= 1250000)) {
return false;
}

// Leaving close orders, as withdrawal of existing should be ok
switch (type) {
Expand Down

0 comments on commit b5d203d

Please sign in to comment.