mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-06 22:29:10 -04:00
Move comment closer to timer creation
For consistency across classes.
This commit is contained in:
parent
b814eff5f1
commit
0d32a3b5ce
3 changed files with 6 additions and 6 deletions
|
@ -67,8 +67,8 @@ public class GetDataRequestHandler {
|
||||||
GetDataResponse getDataResponse = new GetDataResponse(new HashSet<>(dataStorage.getMap().values()),
|
GetDataResponse getDataResponse = new GetDataResponse(new HashSet<>(dataStorage.getMap().values()),
|
||||||
getDataRequest.getNonce());
|
getDataRequest.getNonce());
|
||||||
|
|
||||||
if (timeoutTimer == null) { // setup before sending to avoid race conditions
|
if (timeoutTimer == null) {
|
||||||
timeoutTimer = UserThread.runAfter(() -> {
|
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
|
||||||
String errorMessage = "A timeout occurred for getDataResponse:" + getDataResponse +
|
String errorMessage = "A timeout occurred for getDataResponse:" + getDataResponse +
|
||||||
" on connection:" + connection;
|
" on connection:" + connection;
|
||||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
|
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
|
||||||
|
|
|
@ -88,8 +88,8 @@ public class RequestDataHandler implements MessageListener {
|
||||||
else
|
else
|
||||||
getDataRequest = new GetUpdatedDataRequest(networkNode.getNodeAddress(), nonce);
|
getDataRequest = new GetUpdatedDataRequest(networkNode.getNodeAddress(), nonce);
|
||||||
|
|
||||||
if (timeoutTimer == null) { // setup before sending to avoid race conditions
|
if (timeoutTimer == null) {
|
||||||
timeoutTimer = UserThread.runAfter(() -> {
|
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
|
||||||
if (!stopped) {
|
if (!stopped) {
|
||||||
String errorMessage = "A timeout occurred at sending getDataRequest:" + getDataRequest +
|
String errorMessage = "A timeout occurred at sending getDataRequest:" + getDataRequest +
|
||||||
" on nodeAddress:" + nodeAddress;
|
" on nodeAddress:" + nodeAddress;
|
||||||
|
|
|
@ -85,8 +85,8 @@ class PeerExchangeHandler implements MessageListener {
|
||||||
if (networkNode.getNodeAddress() != null) {
|
if (networkNode.getNodeAddress() != null) {
|
||||||
GetPeersRequest getPeersRequest = new GetPeersRequest(networkNode.getNodeAddress(), nonce, peerManager.getConnectedNonSeedNodeReportedPeers(nodeAddress));
|
GetPeersRequest getPeersRequest = new GetPeersRequest(networkNode.getNodeAddress(), nonce, peerManager.getConnectedNonSeedNodeReportedPeers(nodeAddress));
|
||||||
|
|
||||||
if (timeoutTimer == null) { // setup before sending to avoid race conditions
|
if (timeoutTimer == null) {
|
||||||
timeoutTimer = UserThread.runAfter(() -> {
|
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
|
||||||
if (!stopped) {
|
if (!stopped) {
|
||||||
String errorMessage = "A timeout occurred at sending getPeersRequest:" + getPeersRequest + " for nodeAddress:" + nodeAddress;
|
String errorMessage = "A timeout occurred at sending getPeersRequest:" + getPeersRequest + " for nodeAddress:" + nodeAddress;
|
||||||
log.info(errorMessage + " / PeerExchangeHandler=" +
|
log.info(errorMessage + " / PeerExchangeHandler=" +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue