Renamed a few variables and methods that weren't caught in previous refactors.

This commit is contained in:
CalDescent 2021-08-14 14:01:30 +01:00
parent b18b686545
commit 09e783fbf6
3 changed files with 11 additions and 12 deletions

View File

@ -515,9 +515,9 @@ public class ArbitraryResource {
LOGGER.info("Invalid base58 encoded string");
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.INVALID_DATA);
}
Message getDataFileMessage = new GetArbitraryDataFileMessage(digest);
Message getArbitraryDataFileMessage = new GetArbitraryDataFileMessage(digest);
Message message = targetPeer.getResponse(getDataFileMessage);
Message message = targetPeer.getResponse(getArbitraryDataFileMessage);
if (message == null) {
return false;
}

View File

@ -170,9 +170,9 @@ public class ArbitraryDataManager extends Thread {
String hash58 = Base58.encode(hash);
LOGGER.info(String.format("Fetching data file %.8s from peer %s", hash58, peer));
arbitraryDataFileRequests.put(hash58, NTP.getTime());
Message getDataFileMessage = new GetArbitraryDataFileMessage(hash);
Message getArbitraryDataFileMessage = new GetArbitraryDataFileMessage(hash);
Message message = peer.getResponse(getDataFileMessage);
Message message = peer.getResponse(getArbitraryDataFileMessage);
arbitraryDataFileRequests.remove(hash58);
LOGGER.info(String.format("Removed hash %.8s from arbitraryDataFileRequests", hash58));
@ -313,10 +313,10 @@ public class ArbitraryDataManager extends Thread {
}
}
public void onNetworkGetDataFileMessage(Peer peer, Message message) {
public void onNetworkGetArbitraryDataFileMessage(Peer peer, Message message) {
GetArbitraryDataFileMessage getArbitraryDataFileMessage = (GetArbitraryDataFileMessage) message;
byte[] hash = getArbitraryDataFileMessage.getHash();
Controller.getInstance().stats.getDataFileMessageStats.requests.incrementAndGet();
Controller.getInstance().stats.getArbitraryDataFileMessageStats.requests.incrementAndGet();
ArbitraryDataFile arbitraryDataFile = ArbitraryDataFile.fromHash(hash);
if (arbitraryDataFile.exists()) {
@ -331,7 +331,7 @@ public class ArbitraryDataManager extends Thread {
else {
// We don't have this file
Controller.getInstance().stats.getDataFileMessageStats.unknownFiles.getAndIncrement();
Controller.getInstance().stats.getArbitraryDataFileMessageStats.unknownFiles.getAndIncrement();
// Send valid, yet unexpected message type in response, so peer's synchronizer doesn't have to wait for timeout
LOGGER.debug(() -> String.format("Sending 'file unknown' response to peer %s for GET_FILE request for unknown file %s", peer, arbitraryDataFile));

View File

@ -15,7 +15,6 @@ import org.qortal.block.BlockChain;
import org.qortal.block.BlockChain.BlockTimingByHeight;
import org.qortal.controller.Synchronizer.SynchronizationResult;
import org.qortal.controller.tradebot.TradeBot;
import org.qortal.crypto.Crypto;
import org.qortal.data.account.MintingAccountData;
import org.qortal.data.account.RewardShareData;
import org.qortal.data.block.BlockData;
@ -200,14 +199,14 @@ public class Controller extends Thread {
}
public GetBlockSignaturesV2Stats getBlockSignaturesV2Stats = new GetBlockSignaturesV2Stats();
public static class GetDataFileMessageStats {
public static class GetArbitraryDataFileMessageStats {
public AtomicLong requests = new AtomicLong();
public AtomicLong unknownFiles = new AtomicLong();
public GetDataFileMessageStats() {
public GetArbitraryDataFileMessageStats() {
}
}
public GetDataFileMessageStats getDataFileMessageStats = new GetDataFileMessageStats();
public GetArbitraryDataFileMessageStats getArbitraryDataFileMessageStats = new GetArbitraryDataFileMessageStats();
public static class GetArbitraryDataFileListMessageStats {
public AtomicLong requests = new AtomicLong();
@ -1247,7 +1246,7 @@ public class Controller extends Thread {
break;
case GET_ARBITRARY_DATA_FILE:
ArbitraryDataManager.getInstance().onNetworkGetDataFileMessage(peer, message);
ArbitraryDataManager.getInstance().onNetworkGetArbitraryDataFileMessage(peer, message);
break;
case GET_ARBITRARY_DATA_FILE_LIST: