mirror of
https://github.com/boldsuck/haveno.git
synced 2025-01-03 14:49:25 +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() {
|
public void placeOffer() {
|
||||||
|
|
||||||
timeoutTimer = UserThread.runAfter(() -> {
|
startTimeoutTimer();
|
||||||
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
|
||||||
}, TradeProtocol.TRADE_TIMEOUT);
|
|
||||||
|
|
||||||
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
||||||
() -> {
|
() -> {
|
||||||
|
|
||||||
|
// reset timer if response not yet received
|
||||||
|
if (model.getSignOfferResponse() == null) startTimeoutTimer();
|
||||||
},
|
},
|
||||||
(errorMessage) -> {
|
(errorMessage) -> {
|
||||||
handleError(errorMessage);
|
handleError(errorMessage);
|
||||||
|
@ -99,10 +100,7 @@ public class PlaceOfferProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset timer
|
// reset timer
|
||||||
stopTimeoutTimer();
|
startTimeoutTimer();
|
||||||
timeoutTimer = UserThread.runAfter(() -> {
|
|
||||||
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
|
||||||
}, TradeProtocol.TRADE_TIMEOUT);
|
|
||||||
|
|
||||||
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
TaskRunner<PlaceOfferModel> taskRunner = new TaskRunner<>(model,
|
||||||
() -> {
|
() -> {
|
||||||
|
@ -130,6 +128,13 @@ public class PlaceOfferProtocol {
|
||||||
taskRunner.run();
|
taskRunner.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startTimeoutTimer() {
|
||||||
|
stopTimeoutTimer();
|
||||||
|
timeoutTimer = UserThread.runAfter(() -> {
|
||||||
|
handleError(Res.get("createOffer.timeoutAtPublishing"));
|
||||||
|
}, TradeProtocol.TRADE_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
private void stopTimeoutTimer() {
|
private void stopTimeoutTimer() {
|
||||||
if (timeoutTimer != null) {
|
if (timeoutTimer != null) {
|
||||||
timeoutTimer.stop();
|
timeoutTimer.stop();
|
||||||
|
|
Loading…
Reference in a new issue