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>() {
|
||||
@Override
|
||||
public void onSuccess(Connection connection) {
|
||||
log.trace("Send DataResponse to {} succeeded. getDataResponse={}",
|
||||
connection.getPeersNodeAddressOptional(), getDataResponse);
|
||||
cleanup();
|
||||
listener.onComplete();
|
||||
if (!stopped) {
|
||||
log.trace("Send DataResponse to {} succeeded. getDataResponse={}",
|
||||
connection.getPeersNodeAddressOptional(), getDataResponse);
|
||||
cleanup();
|
||||
listener.onComplete();
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onSuccess call.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NotNull Throwable throwable) {
|
||||
String errorMessage = "Sending getDataRequest to " + connection +
|
||||
" failed. That is expected if the peer is offline. getDataResponse=" + getDataResponse + "." +
|
||||
"Exception: " + throwable.getMessage();
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, connection);
|
||||
if (!stopped) {
|
||||
String errorMessage = "Sending getDataRequest to " + connection +
|
||||
" failed. That is expected if the peer is offline. getDataResponse=" + getDataResponse + "." +
|
||||
"Exception: " + throwable.getMessage();
|
||||
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