Skip to content

Commit

Permalink
Allow refresh at least every 4 hours
Browse files Browse the repository at this point in the history
  • Loading branch information
sqrrm authored and ripcurlx committed Mar 11, 2020
1 parent a183d3b commit 9499967
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/bisq/core/trade/Trade.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

import java.time.temporal.ChronoUnit;

import java.util.Date;
import java.util.HashSet;
import java.util.Optional;
Expand Down Expand Up @@ -424,6 +426,7 @@ public static protobuf.Trade.TradePeriodState toProtoMessage(Trade.TradePeriodSt
private long lastRefreshRequestDate;
@Getter
private long refreshInterval;
private static final long MAX_REFRESH_INTERVAL = 4 * ChronoUnit.HOURS.getDuration().toMillis();

///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, initialization
Expand Down Expand Up @@ -454,7 +457,7 @@ protected Trade(Offer offer,
takeOfferDate = new Date().getTime();
processModel = new ProcessModel();
lastRefreshRequestDate = takeOfferDate;
refreshInterval = offer.getPaymentMethod().getMaxTradePeriod() / 5;
refreshInterval = Math.min(offer.getPaymentMethod().getMaxTradePeriod() / 5, MAX_REFRESH_INTERVAL);
}


Expand Down

0 comments on commit 9499967

Please sign in to comment.