Move comment closer to timer creation

For consistency across classes.
This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-05 10:25:42 +02:00
parent b814eff5f1
commit 0d32a3b5ce
3 changed files with 6 additions and 6 deletions

View File

@ -67,8 +67,8 @@ public class GetDataRequestHandler {
GetDataResponse getDataResponse = new GetDataResponse(new HashSet<>(dataStorage.getMap().values()),
getDataRequest.getNonce());
if (timeoutTimer == null) { // setup before sending to avoid race conditions
timeoutTimer = UserThread.runAfter(() -> {
if (timeoutTimer == null) {
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
String errorMessage = "A timeout occurred for getDataResponse:" + getDataResponse +
" on connection:" + connection;
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);

View File

@ -88,8 +88,8 @@ public class RequestDataHandler implements MessageListener {
else
getDataRequest = new GetUpdatedDataRequest(networkNode.getNodeAddress(), nonce);
if (timeoutTimer == null) { // setup before sending to avoid race conditions
timeoutTimer = UserThread.runAfter(() -> {
if (timeoutTimer == null) {
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
if (!stopped) {
String errorMessage = "A timeout occurred at sending getDataRequest:" + getDataRequest +
" on nodeAddress:" + nodeAddress;

View File

@ -85,8 +85,8 @@ class PeerExchangeHandler implements MessageListener {
if (networkNode.getNodeAddress() != null) {
GetPeersRequest getPeersRequest = new GetPeersRequest(networkNode.getNodeAddress(), nonce, peerManager.getConnectedNonSeedNodeReportedPeers(nodeAddress));
if (timeoutTimer == null) { // setup before sending to avoid race conditions
timeoutTimer = UserThread.runAfter(() -> {
if (timeoutTimer == null) {
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
if (!stopped) {
String errorMessage = "A timeout occurred at sending getPeersRequest:" + getPeersRequest + " for nodeAddress:" + nodeAddress;
log.info(errorMessage + " / PeerExchangeHandler=" +