Remove DevEnv.isDevTesting

Add check for number of confirmations in devMode to show support button after 5 blocks

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2022-12-09 14:23:21 -05:00
parent e3a0ae9425
commit 46b2cf914b
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
3 changed files with 7 additions and 8 deletions

View File

@ -44,10 +44,6 @@ public class DevEnv {
return devMode;
}
public static boolean isDevTesting() {
return false;
}
public static void setDevMode(boolean devMode) {
DevEnv.devMode = devMode;
}

View File

@ -731,7 +731,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
clockWatcher.addListener(new ClockWatcher.Listener() {
@Override
public void onSecondTick() {
if (DevEnv.isDevTesting()) {
if (DevEnv.isDevMode()) {
updateTradePeriodState();
}
}
@ -748,8 +748,11 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
if (!trade.isPayoutPublished()) {
Date maxTradePeriodDate = trade.getMaxTradePeriodDate();
Date halfTradePeriodDate = trade.getHalfTradePeriodDate();
if (DevEnv.isDevTesting()) {
trade.setTradePeriodState(Trade.TradePeriodState.TRADE_PERIOD_OVER);
if (DevEnv.isDevMode()) {
TransactionConfidence confidenceForTxId = btcWalletService.getConfidenceForTxId(trade.getDepositTxId());
if (confidenceForTxId != null && confidenceForTxId.getDepthInBlocks() > 4) {
trade.setTradePeriodState(Trade.TradePeriodState.TRADE_PERIOD_OVER);
}
}
if (maxTradePeriodDate != null && halfTradePeriodDate != null) {
Date now = new Date();

View File

@ -274,7 +274,7 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
break;
case TRADE_PERIOD_OVER:
key = "displayTradePeriodOver" + trade.getId();
if (DontShowAgainLookup.showAgain(key) && !DevEnv.isDevTesting()) {
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().warning(Res.get("popup.warning.tradePeriod.ended",
trade.getShortId(),