mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-24 07:30:54 -04:00
Refactor handshake out for peers request
This commit is contained in:
parent
cd5ecbb168
commit
a856fa36d3
10 changed files with 405 additions and 236 deletions
|
@ -134,13 +134,15 @@ public class OfferAvailabilityProtocol {
|
|||
}
|
||||
|
||||
private void startTimeout() {
|
||||
stopTimeout();
|
||||
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
log.warn("Timeout reached");
|
||||
model.offer.setState(Offer.State.OFFERER_OFFLINE);
|
||||
errorMessageHandler.handleErrorMessage("Timeout reached: Peer has not responded.");
|
||||
}, TIMEOUT_SEC);
|
||||
if (timeoutTimer == null) {
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
log.warn("Timeout reached at " + this);
|
||||
model.offer.setState(Offer.State.OFFERER_OFFLINE);
|
||||
errorMessageHandler.handleErrorMessage("Timeout reached: Peer has not responded.");
|
||||
}, TIMEOUT_SEC);
|
||||
} else {
|
||||
log.warn("timeoutTimer already created. That must not happen.");
|
||||
}
|
||||
}
|
||||
|
||||
private void stopTimeout() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue