mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-11-17 00:07:49 +00:00
reset timeout timer after maker sends sign offer request
This commit is contained in:
parent
83352ec1e3
commit
5294baf949
1 changed files with 12 additions and 7 deletions
|
@ -62,12 +62,13 @@ public class PlaceOfferProtocol {
|
|||
|
||||
public void placeOffer() {
|
||||
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
||||
}, TradeProtocol.TRADE_TIMEOUT);
|
||||
startTimeoutTimer();
|
||||
|
||||
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
||||
() -> {
|
||||
|
||||
// reset timer if response not yet received
|
||||
if (model.getSignOfferResponse() == null) startTimeoutTimer();
|
||||
},
|
||||
(errorMessage) -> {
|
||||
handleError(errorMessage);
|
||||
|
@ -99,10 +100,7 @@ public class PlaceOfferProtocol {
|
|||
}
|
||||
|
||||
// reset timer
|
||||
stopTimeoutTimer();
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
||||
}, TradeProtocol.TRADE_TIMEOUT);
|
||||
startTimeoutTimer();
|
||||
|
||||
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
||||
() -> {
|
||||
|
@ -130,6 +128,13 @@ public class PlaceOfferProtocol {
|
|||
taskRunner.run();
|
||||
}
|
||||
|
||||
private void startTimeoutTimer() {
|
||||
stopTimeoutTimer();
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
||||
}, TradeProtocol.TRADE_TIMEOUT);
|
||||
}
|
||||
|
||||
private void stopTimeoutTimer() {
|
||||
if (timeoutTimer != null) {
|
||||
timeoutTimer.stop();
|
||||
|
|
Loading…
Reference in a new issue