Skip to content

Commit

Permalink
Remove DevEnv.isDevTesting
Browse files Browse the repository at this point in the history
Add check for number of confirmations in devMode to show support button after 5 blocks

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
  • Loading branch information
HenrikJannsen committed Dec 9, 2022
1 parent 9cdc904 commit df4e874
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions common/src/main/java/bisq/common/app/DevEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public static boolean isDevMode() {
return devMode;
}

public static boolean isDevTesting() {
return false;
}

public static void setDevMode(boolean devMode) {
DevEnv.devMode = devMode;
}
Expand Down
9 changes: 6 additions & 3 deletions core/src/main/java/bisq/core/trade/TradeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ public void applyTradePeriodState() {
clockWatcher.addListener(new ClockWatcher.Listener() {
@Override
public void onSecondTick() {
if (DevEnv.isDevTesting()) {
if (DevEnv.isDevMode()) {
updateTradePeriodState();
}
}
Expand All @@ -748,8 +748,11 @@ private void updateTradePeriodState() {
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();
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/main/java/bisq/desktop/main/MainViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void onSetupComplete() {
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(),
Expand Down

0 comments on commit df4e874

Please sign in to comment.