mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-24 15:35:34 -04:00
Fix issue with dangling msg
This commit is contained in:
parent
38afa428ba
commit
c5ea60c2fe
2 changed files with 17 additions and 4 deletions
|
@ -59,7 +59,7 @@ public class PaymentMethod implements Serializable, Comparable {
|
||||||
public static PaymentMethod BLOCK_CHAINS;
|
public static PaymentMethod BLOCK_CHAINS;
|
||||||
|
|
||||||
public static final List<PaymentMethod> ALL_VALUES = new ArrayList<>(Arrays.asList(
|
public static final List<PaymentMethod> ALL_VALUES = new ArrayList<>(Arrays.asList(
|
||||||
OK_PAY = new PaymentMethod(OK_PAY_ID, 0, HOUR), // tx instant so min. wait time
|
OK_PAY = new PaymentMethod(OK_PAY_ID, 0, DAY), // tx instant so min. wait time
|
||||||
PERFECT_MONEY = new PaymentMethod(PERFECT_MONEY_ID, 0, DAY),
|
PERFECT_MONEY = new PaymentMethod(PERFECT_MONEY_ID, 0, DAY),
|
||||||
SEPA = new PaymentMethod(SEPA_ID, 0, 8 * DAY), // sepa takes 1-3 business days. We use 8 days to include safety for holidays
|
SEPA = new PaymentMethod(SEPA_ID, 0, 8 * DAY), // sepa takes 1-3 business days. We use 8 days to include safety for holidays
|
||||||
SWISH = new PaymentMethod(SWISH_ID, 0, DAY),
|
SWISH = new PaymentMethod(SWISH_ID, 0, DAY),
|
||||||
|
|
|
@ -122,8 +122,14 @@ public class AuthenticationHandshake implements MessageListener {
|
||||||
// now we add the reported peers to our list
|
// now we add the reported peers to our list
|
||||||
addReportedPeersConsumer.accept(authenticationChallenge.reportedPeers, connection);
|
addReportedPeersConsumer.accept(authenticationChallenge.reportedPeers, connection);
|
||||||
} else {
|
} else {
|
||||||
log.warn("Verification of nonce failed. nonce={} / peerAddress={} / authenticationChallenge={}", nonce, peerAddress, authenticationChallenge);
|
// We don't call failed as it might be that we get an old authenticationChallenge from a
|
||||||
failed(new Exception("Verification of nonce failed. AuthenticationChallenge=" + authenticationChallenge + " / nonceMap=" + nonce));
|
// previously timed out request
|
||||||
|
// We simply ignore the authenticationChallenge if the nonce is not matching to avoid that
|
||||||
|
// the current authentication turn gets terminated as well
|
||||||
|
log.warn("Verification of nonce failed. Maybe we got an old authenticationChallenge " +
|
||||||
|
"from a timed out request" +
|
||||||
|
"\nnonce={} / peerAddress={} / authenticationChallenge={}", nonce, peerAddress, authenticationChallenge);
|
||||||
|
//failed(new AuthenticationException("Verification of nonce failed. AuthenticationChallenge=" + authenticationChallenge + " / nonceMap=" + nonce));
|
||||||
}
|
}
|
||||||
} else if (message instanceof AuthenticationFinalResponse) {
|
} else if (message instanceof AuthenticationFinalResponse) {
|
||||||
// Responding peer
|
// Responding peer
|
||||||
|
@ -137,8 +143,15 @@ public class AuthenticationHandshake implements MessageListener {
|
||||||
+ (System.currentTimeMillis() - startAuthTs) + " ms.");
|
+ (System.currentTimeMillis() - startAuthTs) + " ms.");
|
||||||
completed(connection);
|
completed(connection);
|
||||||
} else {
|
} else {
|
||||||
|
// We don't call failed as it might be that we get an old authenticationFinalResponse from a
|
||||||
|
// previously timed out request
|
||||||
|
// We simply ignore the authenticationFinalResponse if the nonce is not matching to avoid that
|
||||||
|
// the current authentication turn gets terminated as well
|
||||||
|
log.warn("Verification of nonce failed. Maybe we got an old authenticationFinalResponse " +
|
||||||
|
"from a timed out request" +
|
||||||
|
"\nnonce={} / peerAddress={} / authenticationChallenge={}", nonce, peerAddress, authenticationFinalResponse);
|
||||||
log.warn("Verification of nonce failed. nonce={} / peerAddress={} / authenticationFinalResponse={}", nonce, peerAddress, authenticationFinalResponse);
|
log.warn("Verification of nonce failed. nonce={} / peerAddress={} / authenticationFinalResponse={}", nonce, peerAddress, authenticationFinalResponse);
|
||||||
failed(new Exception("Verification of nonce failed. getPeersMessage=" + authenticationFinalResponse + " / nonce=" + nonce));
|
//failed(new AuthenticationException("Verification of nonce failed. getPeersMessage=" + authenticationFinalResponse + " / nonce=" + nonce));
|
||||||
}
|
}
|
||||||
} else if (message instanceof AuthenticationRejection) {
|
} else if (message instanceof AuthenticationRejection) {
|
||||||
// Any peer
|
// Any peer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue