fix error popup on delete outdated tor files

This commit is contained in:
woodser 2024-07-06 08:45:28 -04:00
parent 9c359b5e29
commit ff0ccc21e2
2 changed files with 61 additions and 52 deletions

View File

@ -140,6 +140,8 @@ class RequestDataHandler implements MessageListener {
getDataRequestType = getDataRequest.getClass().getSimpleName();
log.info("\n\n>> We send a {} to peer {}\n", getDataRequestType, nodeAddress);
networkNode.addMessageListener(this);
try {
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getDataRequest);
//noinspection UnstableApiUsage
Futures.addCallback(future, new FutureCallback<>() {
@ -167,6 +169,9 @@ class RequestDataHandler implements MessageListener {
}
}
}, MoreExecutors.directExecutor());
} catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e;
}
} else {
log.warn("We have stopped already. We ignore that requestData call.");
}

View File

@ -115,6 +115,7 @@ class PeerExchangeHandler implements MessageListener {
TIMEOUT, TimeUnit.SECONDS);
}
try {
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getPeersRequest);
Futures.addCallback(future, new FutureCallback<Connection>() {
@Override
@ -144,6 +145,9 @@ class PeerExchangeHandler implements MessageListener {
}
}
}, MoreExecutors.directExecutor());
} catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e;
}
} else {
log.debug("My node address is still null at sendGetPeersRequest. We ignore that call.");
}