mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Ignore data request message success or failure after a timeout
This commit is contained in:
parent
00df057e09
commit
846cdb743f
1 changed files with 16 additions and 8 deletions
|
@ -80,18 +80,26 @@ public class GetDataRequestHandler {
|
||||||
Futures.addCallback(future, new FutureCallback<Connection>() {
|
Futures.addCallback(future, new FutureCallback<Connection>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Connection connection) {
|
public void onSuccess(Connection connection) {
|
||||||
|
if (!stopped) {
|
||||||
log.trace("Send DataResponse to {} succeeded. getDataResponse={}",
|
log.trace("Send DataResponse to {} succeeded. getDataResponse={}",
|
||||||
connection.getPeersNodeAddressOptional(), getDataResponse);
|
connection.getPeersNodeAddressOptional(), getDataResponse);
|
||||||
cleanup();
|
cleanup();
|
||||||
listener.onComplete();
|
listener.onComplete();
|
||||||
|
} else {
|
||||||
|
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onSuccess call.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NotNull Throwable throwable) {
|
public void onFailure(@NotNull Throwable throwable) {
|
||||||
|
if (!stopped) {
|
||||||
String errorMessage = "Sending getDataRequest to " + connection +
|
String errorMessage = "Sending getDataRequest to " + connection +
|
||||||
" failed. That is expected if the peer is offline. getDataResponse=" + getDataResponse + "." +
|
" failed. That is expected if the peer is offline. getDataResponse=" + getDataResponse + "." +
|
||||||
"Exception: " + throwable.getMessage();
|
"Exception: " + throwable.getMessage();
|
||||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, connection);
|
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, connection);
|
||||||
|
} else {
|
||||||
|
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue