mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Cleanup logs. Use debug instead of info to get less load of logs if info is default log level
This commit is contained in:
parent
f0da970453
commit
e3480d0995
55 changed files with 181 additions and 182 deletions
|
@ -34,6 +34,7 @@ import java.security.interfaces.DSAParams;
|
|||
import java.security.interfaces.DSAPrivateKey;
|
||||
import java.security.interfaces.RSAPrivateCrtKey;
|
||||
import java.security.spec.*;
|
||||
import java.util.Date;
|
||||
|
||||
// TODO: use a password protection for key storage
|
||||
public class KeyStorage {
|
||||
|
@ -124,7 +125,7 @@ public class KeyStorage {
|
|||
throw new RuntimeException("Unsupported key algo" + keyEntry.getAlgorithm());
|
||||
}
|
||||
|
||||
//log.info("load completed in {} msec", System.currentTimeMillis() - now);
|
||||
log.debug("load completed in {} msec", System.currentTimeMillis() - new Date().getTime());
|
||||
return new KeyPair(publicKey, privateKey);
|
||||
} catch (NoSuchAlgorithmException | InvalidKeySpecException | NoSuchProviderException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -24,7 +24,7 @@ public class Profiler {
|
|||
private static final Logger log = LoggerFactory.getLogger(Profiler.class);
|
||||
|
||||
public static void printSystemLoad(Logger log) {
|
||||
log.warn(printSystemLoadString());
|
||||
log.debug(printSystemLoadString());
|
||||
}
|
||||
|
||||
public static String printSystemLoadString() {
|
||||
|
|
|
@ -145,7 +145,7 @@ public class SeedPeersSocks5Dns implements PeerDiscovery {
|
|||
InetAddress addrResolved = proxySocket.getInetAddress();
|
||||
proxySocket.close();
|
||||
if( addrResolved != null ) {
|
||||
log.info("Resolved " + addr.getHostString() + " to " + addrResolved.getHostAddress() );
|
||||
log.debug("Resolved " + addr.getHostString() + " to " + addrResolved.getHostAddress());
|
||||
return new InetSocketAddress(addrResolved, addr.getPort() );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -981,7 +981,7 @@ public class TradeWalletService {
|
|||
transaction.addOutput(buyerPayoutAmount, new Address(params, buyerAddressString));
|
||||
transaction.addOutput(sellerPayoutAmount, new Address(params, sellerAddressString));
|
||||
if (lockTime != 0) {
|
||||
log.info("We use a lockTime of " + lockTime);
|
||||
log.debug("We use a lockTime of " + lockTime);
|
||||
// When using lockTime we need to set sequenceNumber to 0
|
||||
transaction.getInputs().stream().forEach(i -> i.setSequenceNumber(0));
|
||||
transaction.setLockTime(lockTime);
|
||||
|
|
|
@ -714,7 +714,7 @@ public class WalletService {
|
|||
public void doubleSpendTransaction(Transaction txToDoubleSpend, Address toAddress, Runnable resultHandler, ErrorMessageHandler errorMessageHandler) throws InsufficientMoneyException, AddressFormatException, AddressEntryException {
|
||||
final TransactionConfidence.ConfidenceType confidenceType = txToDoubleSpend.getConfidence().getConfidenceType();
|
||||
if (confidenceType == TransactionConfidence.ConfidenceType.PENDING) {
|
||||
log.info("txToDoubleSpend nr. of inputs " + txToDoubleSpend.getInputs().size());
|
||||
log.debug("txToDoubleSpend nr. of inputs " + txToDoubleSpend.getInputs().size());
|
||||
|
||||
Transaction newTransaction = new Transaction(params);
|
||||
txToDoubleSpend.getInputs().stream().forEach(input -> {
|
||||
|
@ -739,8 +739,8 @@ public class WalletService {
|
|||
}
|
||||
);
|
||||
|
||||
log.info("newTransaction nr. of inputs " + newTransaction.getInputs().size());
|
||||
log.info("newTransaction size in kB " + newTransaction.bitcoinSerialize().length / 1024);
|
||||
log.debug("newTransaction nr. of inputs " + newTransaction.getInputs().size());
|
||||
log.debug("newTransaction size in kB " + newTransaction.bitcoinSerialize().length / 1024);
|
||||
|
||||
if (!newTransaction.getInputs().isEmpty()) {
|
||||
Coin amount = Coin.valueOf(newTransaction.getInputs().stream()
|
||||
|
@ -795,7 +795,7 @@ public class WalletService {
|
|||
}
|
||||
}
|
||||
if (sendResult != null) {
|
||||
log.info("Broadcasting double spending transaction. " + newTransaction);
|
||||
log.debug("Broadcasting double spending transaction. " + newTransaction);
|
||||
Futures.addCallback(sendResult.broadcastComplete, new FutureCallback<Transaction>() {
|
||||
@Override
|
||||
public void onSuccess(Transaction result) {
|
||||
|
@ -835,9 +835,9 @@ public class WalletService {
|
|||
newSendRequest.feePerKb = FeePolicy.getNonTradeFeePerKb();
|
||||
wallet.completeTx(newSendRequest);
|
||||
|
||||
log.info("After fee check: amount " + amount.toFriendlyString());
|
||||
log.info("Output fee " + sendRequest.tx.getFee().toFriendlyString());
|
||||
sendRequest.tx.getOutputs().stream().forEach(o -> log.info("Output value " + o.getValue().toFriendlyString()));
|
||||
log.debug("After fee check: amount " + amount.toFriendlyString());
|
||||
log.debug("Output fee " + sendRequest.tx.getFee().toFriendlyString());
|
||||
sendRequest.tx.getOutputs().stream().forEach(o -> log.debug("Output value " + o.getValue().toFriendlyString()));
|
||||
} catch (InsufficientMoneyException e) {
|
||||
if (e.missing != null) {
|
||||
log.trace("missing fee " + e.missing.toFriendlyString());
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BlockchainService {
|
|||
Futures.addCallback(future, new FutureCallback<Coin>() {
|
||||
public void onSuccess(Coin fee) {
|
||||
if (!resultFuture.isDone()) {
|
||||
log.info("Request fee from providers done after {} ms.", (System.currentTimeMillis() - startTime));
|
||||
log.debug("Request fee from providers done after {} ms.", (System.currentTimeMillis() - startTime));
|
||||
resultFuture.set(fee);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class GetFeeRequest {
|
|||
try {
|
||||
return provider.getFee(transactionId);
|
||||
} catch (IOException | HttpException e) {
|
||||
log.info("Fee request failed for tx {} from provider {}\n" +
|
||||
log.debug("Fee request failed for tx {} from provider {}\n" +
|
||||
"That is expected if the tx was not propagated yet to the provider.\n" +
|
||||
"error={}",
|
||||
transactionId, provider, e.getMessage());
|
||||
|
@ -43,7 +43,7 @@ class GetFeeRequest {
|
|||
|
||||
Futures.addCallback(future, new FutureCallback<Coin>() {
|
||||
public void onSuccess(Coin fee) {
|
||||
log.info("Received fee of {}\nfor tx {}\nfrom provider {}", fee.toFriendlyString(), transactionId, provider);
|
||||
log.debug("Received fee of {}\nfor tx {}\nfrom provider {}", fee.toFriendlyString(), transactionId, provider);
|
||||
resultFuture.set(fee);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@ public class ScryptUtil {
|
|||
public static void deriveKeyWithScrypt(KeyCrypterScrypt keyCrypterScrypt, String password, DeriveKeyResultHandler resultHandler) {
|
||||
Utilities.getThreadPoolExecutor("ScryptUtil:deriveKeyWithScrypt-%d", 1, 2, 5L).submit(() -> {
|
||||
try {
|
||||
log.info("Doing key derivation");
|
||||
log.debug("Doing key derivation");
|
||||
long start = System.currentTimeMillis();
|
||||
KeyParameter aesKey = keyCrypterScrypt.deriveKey(password);
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
log.info("Key derivation took {} msec", duration);
|
||||
log.debug("Key derivation took {} msec", duration);
|
||||
UserThread.execute(() -> {
|
||||
try {
|
||||
resultHandler.handleResult(aesKey);
|
||||
|
|
|
@ -280,7 +280,7 @@ public class TradeManager {
|
|||
// TODO respond
|
||||
//(RequestDepositTxInputsMessage)message.
|
||||
// messageService.sendEncryptedMessage(peerAddress,messageWithPubKey.getMessage().);
|
||||
log.info("We received a take offer request but don't have that offer anymore.");
|
||||
log.debug("We received a take offer request but don't have that offer anymore.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -382,7 +382,7 @@ public class TradeManager {
|
|||
@Override
|
||||
public void onSuccess(@javax.annotation.Nullable Transaction transaction) {
|
||||
if (transaction != null) {
|
||||
log.info("onWithdraw onSuccess tx ID:" + transaction.getHashAsString());
|
||||
log.debug("onWithdraw onSuccess tx ID:" + transaction.getHashAsString());
|
||||
addTradeToClosedTrades(trade);
|
||||
trade.setState(Trade.State.WITHDRAW_COMPLETED);
|
||||
resultHandler.handleResult();
|
||||
|
|
|
@ -114,7 +114,7 @@ public final class OpenOffer implements Tradable {
|
|||
stopTimeout();
|
||||
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
log.info("Timeout for resettin State.RESERVED reached");
|
||||
log.debug("Timeout for resettin State.RESERVED reached");
|
||||
if (state == State.RESERVED)
|
||||
setState(State.AVAILABLE);
|
||||
}, TIMEOUT_SEC);
|
||||
|
|
|
@ -152,7 +152,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
stopPeriodicRepublishOffersTimer();
|
||||
stopRetryRepublishOffersTimer();
|
||||
|
||||
log.info("remove all open offers at shutDown");
|
||||
log.debug("remove all open offers at shutDown");
|
||||
// we remove own offers from offerbook when we go offline
|
||||
// Normally we use a delay for broadcasting to the peers, but at shut down we want to get it fast out
|
||||
|
||||
|
@ -407,12 +407,12 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
|
||||
@Override
|
||||
public void onFault() {
|
||||
log.info("Sending OfferAvailabilityResponse failed.");
|
||||
log.debug("Sending OfferAvailabilityResponse failed.");
|
||||
}
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
log.info("Exception at handleRequestIsOfferAvailableMessage " + t.getMessage());
|
||||
log.debug("Exception at handleRequestIsOfferAvailableMessage " + t.getMessage());
|
||||
}
|
||||
} else {
|
||||
log.debug("We have stopped already. We ignore that handleOfferAvailabilityRequest call.");
|
||||
|
@ -532,7 +532,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
}
|
||||
|
||||
private void restart() {
|
||||
log.info("Restart after connection loss");
|
||||
log.debug("Restart after connection loss");
|
||||
if (retryRepublishOffersTimer == null)
|
||||
retryRepublishOffersTimer = UserThread.runAfter(() -> {
|
||||
stopped = false;
|
||||
|
|
|
@ -135,7 +135,7 @@ public class OfferAvailabilityProtocol {
|
|||
private void startTimeout() {
|
||||
if (timeoutTimer == null) {
|
||||
timeoutTimer = UserThread.runAfter(() -> {
|
||||
log.warn("Timeout reached at " + this);
|
||||
log.debug("Timeout reached at " + this);
|
||||
model.offer.setState(Offer.State.OFFERER_OFFLINE);
|
||||
errorMessageHandler.handleErrorMessage("Timeout reached: Peer has not responded.");
|
||||
}, TIMEOUT_SEC);
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BroadcastCreateOfferFeeTx extends Task<PlaceOfferModel> {
|
|||
model.tradeWalletService.broadcastTx(model.getTransaction(), new FutureCallback<Transaction>() {
|
||||
@Override
|
||||
public void onSuccess(Transaction transaction) {
|
||||
log.info("Broadcast of offer fee payment succeeded: transaction = " + transaction.toString());
|
||||
log.debug("Broadcast of offer fee payment succeeded: transaction = " + transaction.toString());
|
||||
|
||||
if (model.getTransaction().getHashAsString().equals(transaction.getHashAsString())) {
|
||||
model.offer.setState(Offer.State.OFFER_FEE_PAID);
|
||||
|
@ -57,7 +57,7 @@ public class BroadcastCreateOfferFeeTx extends Task<PlaceOfferModel> {
|
|||
// Normally we use a delay for broadcasting to the peers, but at shut down we want to get it fast out
|
||||
model.offerBookService.removeOffer(model.offer,
|
||||
() -> {
|
||||
log.info("We store now the changed txID to the offer and add that again.");
|
||||
log.debug("We store now the changed txID to the offer and add that again.");
|
||||
// We store now the changed txID to the offer and add that again.
|
||||
model.offer.setOfferFeePaymentTxID(transaction.getHashAsString());
|
||||
model.setTransaction(transaction);
|
||||
|
@ -106,7 +106,7 @@ public class BroadcastCreateOfferFeeTx extends Task<PlaceOfferModel> {
|
|||
if (!removeOfferFailed && !addOfferFailed) {
|
||||
// If broadcast fails we need to remove offer from offerbook
|
||||
model.offerBookService.removeOffer(model.offer,
|
||||
() -> log.info("Offer removed from offerbook because broadcast failed."),
|
||||
() -> log.debug("Offer removed from offerbook because broadcast failed."),
|
||||
errorMessage -> log.error("removeOffer failed. " + errorMessage));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public abstract class TradeTask extends Task<Trade> {
|
|||
if (processModel.getTradeMessage() instanceof MailboxMessage) {
|
||||
DecryptedMsgWithPubKey mailboxMessage = trade.getMailboxMessage();
|
||||
if (mailboxMessage != null && mailboxMessage.message.equals(processModel.getTradeMessage())) {
|
||||
log.info("Remove mailboxMessage from P2P network. mailboxMessage = " + mailboxMessage);
|
||||
log.debug("Remove mailboxMessage from P2P network. mailboxMessage = " + mailboxMessage);
|
||||
processModel.getP2PService().removeEntryFromMailbox(mailboxMessage);
|
||||
trade.setMailboxMessage(null);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class OffererCreatesAndSignsDepositTxAsBuyer extends TradeTask {
|
|||
Coin buyerInputAmount = FeePolicy.getSecurityDeposit().add(FeePolicy.getFixedTxFeeForTrades());
|
||||
Coin msOutputAmount = buyerInputAmount.add(FeePolicy.getSecurityDeposit()).add(trade.getTradeAmount());
|
||||
|
||||
log.info("\n\n------------------------------------------------------------\n"
|
||||
log.debug("\n\n------------------------------------------------------------\n"
|
||||
+ "Contract as json\n"
|
||||
+ trade.getContractAsJson()
|
||||
+ "\n------------------------------------------------------------\n");
|
||||
|
|
|
@ -48,14 +48,14 @@ public class SendFiatTransferStartedMessage extends TradeTask {
|
|||
new SendMailboxMessageListener() {
|
||||
@Override
|
||||
public void onArrived() {
|
||||
log.info("Message arrived at peer.");
|
||||
log.debug("Message arrived at peer.");
|
||||
trade.setState(Trade.State.BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG);
|
||||
complete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStoredInMailbox() {
|
||||
log.info("Message stored in mailbox.");
|
||||
log.debug("Message stored in mailbox.");
|
||||
trade.setState(Trade.State.BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG);
|
||||
complete();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SignAndPublishDepositTxAsBuyer extends TradeTask {
|
|||
try {
|
||||
runInterceptHook();
|
||||
|
||||
log.info("\n\n------------------------------------------------------------\n"
|
||||
log.debug("\n\n------------------------------------------------------------\n"
|
||||
+ "Contract as json\n"
|
||||
+ trade.getContractAsJson()
|
||||
+ "\n------------------------------------------------------------\n");
|
||||
|
|
|
@ -46,7 +46,7 @@ public class OffererCreatesAndSignsDepositTxAsSeller extends TradeTask {
|
|||
Coin sellerInputAmount = FeePolicy.getSecurityDeposit().add(FeePolicy.getFixedTxFeeForTrades()).add(trade.getTradeAmount());
|
||||
Coin msOutputAmount = sellerInputAmount.add(FeePolicy.getSecurityDeposit());
|
||||
|
||||
log.info("\n\n------------------------------------------------------------\n"
|
||||
log.debug("\n\n------------------------------------------------------------\n"
|
||||
+ "Contract as json\n"
|
||||
+ trade.getContractAsJson()
|
||||
+ "\n------------------------------------------------------------\n");
|
||||
|
|
|
@ -46,7 +46,7 @@ public class SignAndPublishDepositTxAsSeller extends TradeTask {
|
|||
protected void run() {
|
||||
try {
|
||||
runInterceptHook();
|
||||
log.info("\n\n------------------------------------------------------------\n"
|
||||
log.debug("\n\n------------------------------------------------------------\n"
|
||||
+ "Contract as json\n"
|
||||
+ trade.getContractAsJson()
|
||||
+ "\n------------------------------------------------------------\n");
|
||||
|
|
|
@ -64,7 +64,7 @@ public class PublishTradeStatistics extends TradeTask {
|
|||
}
|
||||
}
|
||||
if (!matches) {
|
||||
log.warn("We publish tradeStatistics because the offerer uses an old version.");
|
||||
log.debug("We publish tradeStatistics because the offerer uses an old version so we publish to have at least 1 data item published.");
|
||||
processModel.getP2PService().addData(tradeStatistics, true);
|
||||
} else {
|
||||
log.trace("We do not publish tradeStatistics because the offerer support the capabilities.");
|
||||
|
|
|
@ -265,7 +265,7 @@ public class BitsquareApp extends Application {
|
|||
private void showErrorPopup(Throwable throwable, boolean doShutDown) {
|
||||
if (!shutDownRequested) {
|
||||
if (scene == null) {
|
||||
log.warn("Scene not available yet, we create a new scene. The bug might be caused by a guice circular dependency.");
|
||||
log.warn("Scene not available yet, we create a new scene. The bug might be caused by an exception in a constructor or by a circular dependency in guice.");
|
||||
scene = new Scene(new StackPane(), 1000, 650);
|
||||
scene.getStylesheets().setAll(
|
||||
"/io/bitsquare/gui/bitsquare.css",
|
||||
|
@ -357,7 +357,7 @@ public class BitsquareApp extends Application {
|
|||
.show();
|
||||
UserThread.runAfter(() -> {
|
||||
gracefulShutDown(() -> {
|
||||
log.info("App shutdown complete");
|
||||
log.debug("App shutdown complete");
|
||||
System.exit(0);
|
||||
});
|
||||
}, 200, TimeUnit.MILLISECONDS);
|
||||
|
@ -376,7 +376,7 @@ public class BitsquareApp extends Application {
|
|||
injector.getInstance(P2PService.class).shutDown(() -> {
|
||||
injector.getInstance(WalletService.class).shutDownDone.addListener((ov, o, n) -> {
|
||||
bitsquareAppModule.close(injector);
|
||||
log.info("Graceful shutdown completed");
|
||||
log.debug("Graceful shutdown completed");
|
||||
resultHandler.handleResult();
|
||||
});
|
||||
injector.getInstance(WalletService.class).shutDown();
|
||||
|
@ -388,7 +388,7 @@ public class BitsquareApp extends Application {
|
|||
UserThread.runAfter(resultHandler::handleResult, 1);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
log.info("App shutdown failed with exception");
|
||||
log.debug("App shutdown failed with exception");
|
||||
t.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
|
|
@ -322,8 +322,8 @@ public class MainViewModel implements ViewModel {
|
|||
// Other disconnects might be caused by peers running an older version
|
||||
if (connection.getPeerType() == Connection.PeerType.SEED_NODE &&
|
||||
closeConnectionReason == CloseConnectionReason.RULE_VIOLATION) {
|
||||
log.warn("onDisconnect closeConnectionReason=" + closeConnectionReason);
|
||||
log.warn("onDisconnect connection=" + connection);
|
||||
log.warn("RULE_VIOLATION onDisconnect closeConnectionReason=" + closeConnectionReason);
|
||||
log.warn("RULE_VIOLATION onDisconnect connection=" + connection);
|
||||
//TODO
|
||||
/* new Popup()
|
||||
.warning("You got disconnected from a seed node.\n\n" +
|
||||
|
|
|
@ -263,7 +263,6 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
|
|||
}
|
||||
|
||||
private void doRestore() {
|
||||
log.info("Attempting wallet restore using seed '{}' from date {}", restoreSeedWordsTextArea.getText(), restoreDatePicker.getValue());
|
||||
long date = restoreDatePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
|
||||
DeterministicSeed seed = new DeterministicSeed(Splitter.on(" ").splitToList(restoreSeedWordsTextArea.getText()), null, "", date);
|
||||
walletService.restoreSeedWords(seed,
|
||||
|
|
|
@ -185,7 +185,7 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
|
|||
@Override
|
||||
public void onSuccess(@javax.annotation.Nullable Transaction transaction) {
|
||||
if (transaction != null) {
|
||||
log.info("onWithdraw onSuccess tx ID:" + transaction.getHashAsString());
|
||||
log.debug("onWithdraw onSuccess tx ID:" + transaction.getHashAsString());
|
||||
} else {
|
||||
log.error("onWithdraw transaction is null");
|
||||
}
|
||||
|
|
|
@ -372,7 +372,6 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
|
|||
}
|
||||
|
||||
private void doRestore() {
|
||||
log.info("Attempting wallet restore using seed '{}' from date {}", restoreSeedWordsTextArea.getText(), restoreDatePicker.getValue());
|
||||
long date = restoreDatePicker.getValue().atStartOfDay().toEpochSecond(ZoneOffset.UTC);
|
||||
DeterministicSeed seed = new DeterministicSeed(Splitter.on(" ").splitToList(restoreSeedWordsTextArea.getText()), null, "", date);
|
||||
walletService.restoreSeedWords(seed,
|
||||
|
|
|
@ -304,7 +304,7 @@ public class PendingTradesDataModel extends ActivatableDataModel {
|
|||
if (depositTx != null) {
|
||||
doOpenDispute(isSupportTicket, getTrade().getDepositTx());
|
||||
} else {
|
||||
log.warn("Trade.depositTx is null. We try to find the tx in our wallet.");
|
||||
log.info("Trade.depositTx is null. We try to find the tx in our wallet.");
|
||||
List<Transaction> candidates = new ArrayList<>();
|
||||
List<Transaction> transactions = walletService.getWallet().getRecentTransactions(100, true);
|
||||
transactions.stream().forEach(transaction -> {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ImageUtil {
|
|||
public static boolean isRetina() {
|
||||
float maxRenderScale = ((QuantumToolkit) QuantumToolkit.getToolkit()).getMaxRenderScale();
|
||||
boolean isRetina = maxRenderScale > 1.9f;
|
||||
//log.info("isRetina=" + isRetina + " / maxRenderScale=" + maxRenderScale);
|
||||
//log.debug("isRetina=" + isRetina + " / maxRenderScale=" + maxRenderScale);
|
||||
return isRetina;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public class Headless {
|
|||
|
||||
public void shutDown() {
|
||||
gracefulShutDown(() -> {
|
||||
log.info("Shutdown complete");
|
||||
log.debug("Shutdown complete");
|
||||
System.exit(0);
|
||||
});
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public class Headless {
|
|||
injector.getInstance(P2PService.class).shutDown(() -> {
|
||||
injector.getInstance(WalletService.class).shutDownDone.addListener((ov, o, n) -> {
|
||||
headlessModule.close(injector);
|
||||
log.info("Graceful shutdown completed");
|
||||
log.debug("Graceful shutdown completed");
|
||||
resultHandler.handleResult();
|
||||
});
|
||||
injector.getInstance(WalletService.class).shutDown();
|
||||
|
@ -153,7 +153,7 @@ public class Headless {
|
|||
UserThread.runAfter(resultHandler::handleResult, 1);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
log.info("App shutdown failed with exception");
|
||||
log.debug("App shutdown failed with exception");
|
||||
t.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ public class SOCKS {
|
|||
// /////////////////
|
||||
|
||||
static void inform(String s) {
|
||||
log.info(s);
|
||||
log.debug(s);
|
||||
}
|
||||
|
||||
static void exit(String msg) {
|
||||
|
|
|
@ -158,13 +158,13 @@ public class ProxyServer implements Runnable {
|
|||
ss = new ServerSocket(port, backlog, localIP);
|
||||
final String address = ss.getInetAddress().getHostAddress();
|
||||
final int localPort = ss.getLocalPort();
|
||||
log.info("Starting SOCKS Proxy on: {}:{}", address, localPort);
|
||||
log.debug("Starting SOCKS Proxy on: {}:{}", address, localPort);
|
||||
|
||||
while (true) {
|
||||
final Socket s = ss.accept();
|
||||
final String hostName = s.getInetAddress().getHostName();
|
||||
final int port2 = s.getPort();
|
||||
log.info("Accepted from:{}:{}", hostName, port2);
|
||||
log.debug("Accepted from:{}:{}", hostName, port2);
|
||||
|
||||
final ProxyServer ps = new ProxyServer(auth, s);
|
||||
(new Thread(ps)).start();
|
||||
|
@ -203,7 +203,7 @@ public class ProxyServer implements Runnable {
|
|||
if (auth != null) {
|
||||
auth.endSession();
|
||||
}
|
||||
log.info("Main thread(client->remote)stopped.");
|
||||
log.debug("Main thread(client->remote)stopped.");
|
||||
}
|
||||
break;
|
||||
case ACCEPT_MODE:
|
||||
|
@ -219,7 +219,7 @@ public class ProxyServer implements Runnable {
|
|||
handleException(ioe);
|
||||
} finally {
|
||||
abort();
|
||||
log.info("Accept thread(remote->client) stopped");
|
||||
log.debug("Accept thread(remote->client) stopped");
|
||||
}
|
||||
break;
|
||||
case PIPE_MODE:
|
||||
|
@ -228,7 +228,7 @@ public class ProxyServer implements Runnable {
|
|||
} catch (final IOException ioe) {
|
||||
} finally {
|
||||
abort();
|
||||
log.info("Support thread(remote->client) stopped");
|
||||
log.debug("Support thread(remote->client) stopped");
|
||||
}
|
||||
break;
|
||||
case ABORT_MODE:
|
||||
|
@ -252,7 +252,7 @@ public class ProxyServer implements Runnable {
|
|||
}
|
||||
|
||||
if (auth == null) { // Authentication failed
|
||||
log.info("Authentication failed");
|
||||
log.debug("Authentication failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class ProxyServer implements Runnable {
|
|||
s = new SocksSocket(proxy, msg.ip, msg.port);
|
||||
}
|
||||
|
||||
log.info("Connected to " + s.getInetAddress() + ":" + s.getPort());
|
||||
log.debug("Connected to " + s.getInetAddress() + ":" + s.getPort());
|
||||
|
||||
ProxyMessage response = null;
|
||||
final InetAddress localAddress = s.getLocalAddress();
|
||||
|
@ -367,7 +367,7 @@ public class ProxyServer implements Runnable {
|
|||
|
||||
final InetAddress inetAddress = ss.getInetAddress();
|
||||
final int localPort = ss.getLocalPort();
|
||||
log.info("Trying accept on {}:{}", inetAddress, localPort);
|
||||
log.debug("Trying accept on {}:{}", inetAddress, localPort);
|
||||
|
||||
if (msg.version == 5) {
|
||||
final int cmd = SocksProxyBase.SOCKS_SUCCESS;
|
||||
|
@ -425,7 +425,7 @@ public class ProxyServer implements Runnable {
|
|||
if (msg.ip.getHostAddress().equals("0.0.0.0")) {
|
||||
msg.ip = sock.getInetAddress();
|
||||
}
|
||||
log.info("Creating UDP relay server for {}:{}", msg.ip, msg.port);
|
||||
log.debug("Creating UDP relay server for {}:{}", msg.ip, msg.port);
|
||||
|
||||
relayServer = new UDPRelayServer(msg.ip, msg.port,
|
||||
Thread.currentThread(), sock, auth);
|
||||
|
@ -494,7 +494,7 @@ public class ProxyServer implements Runnable {
|
|||
|
||||
final InetAddress inetAddress = s.getInetAddress();
|
||||
final int port = s.getPort();
|
||||
log.info("Accepted from {}:{}", s.getInetAddress(), port);
|
||||
log.debug("Accepted from {}:{}", s.getInetAddress(), port);
|
||||
|
||||
ProxyMessage response;
|
||||
|
||||
|
@ -564,7 +564,7 @@ public class ProxyServer implements Runnable {
|
|||
}
|
||||
mode = ABORT_MODE;
|
||||
try {
|
||||
log.info("Aborting operation");
|
||||
log.debug("Aborting operation");
|
||||
if (remote_sock != null) {
|
||||
remote_sock.close();
|
||||
}
|
||||
|
|
|
@ -115,8 +115,8 @@ class UDPRelayServer implements Runnable {
|
|||
remote_sock.setSoTimeout(iddleTimeout);
|
||||
client_sock.setSoTimeout(iddleTimeout);
|
||||
|
||||
log.info("Starting UDP relay server on {}:{}", relayIP, relayPort);
|
||||
log.info("Remote socket {}:{}", remote_sock.getLocalAddress(),
|
||||
log.debug("Starting UDP relay server on {}:{}", relayIP, relayPort);
|
||||
log.debug("Remote socket {}:{}", remote_sock.getLocalAddress(),
|
||||
remote_sock.getLocalPort());
|
||||
|
||||
pipe_thread1 = new Thread(this, "pipe1");
|
||||
|
@ -151,7 +151,7 @@ class UDPRelayServer implements Runnable {
|
|||
} catch (final IOException ioe) {
|
||||
} finally {
|
||||
abort();
|
||||
log.info("UDP Pipe thread " + Thread.currentThread().getName()
|
||||
log.debug("UDP Pipe thread " + Thread.currentThread().getName()
|
||||
+ " stopped.");
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ class UDPRelayServer implements Runnable {
|
|||
return;
|
||||
}
|
||||
|
||||
log.info("Aborting UDP Relay Server");
|
||||
log.debug("Aborting UDP Relay Server");
|
||||
|
||||
remote_sock.close();
|
||||
client_sock.close();
|
||||
|
@ -201,7 +201,7 @@ class UDPRelayServer implements Runnable {
|
|||
}
|
||||
|
||||
} catch (final UnknownHostException uhe) {
|
||||
log.info("Dropping datagram for unknown host");
|
||||
log.debug("Dropping datagram for unknown host");
|
||||
} catch (final InterruptedIOException iioe) {
|
||||
// log("Interrupted: "+iioe);
|
||||
// If we were interrupted by other thread.
|
||||
|
|
|
@ -128,7 +128,7 @@ public abstract class OnionProxyManager {
|
|||
if (isBootstrapped() == false) {
|
||||
Thread.sleep(1000, 0);
|
||||
} else {
|
||||
log.info("Tor has bootstrapped");
|
||||
log.debug("Tor has bootstrapped");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public abstract class OnionProxyManager {
|
|||
+ "this.");
|
||||
}
|
||||
|
||||
log.info("Creating hidden service");
|
||||
log.debug("Creating hidden service");
|
||||
File hostnameFile = onionProxyContext.getHostNameFile();
|
||||
|
||||
if (hostnameFile.getParentFile().exists() == false && hostnameFile.getParentFile().mkdirs() == false) {
|
||||
|
@ -257,7 +257,7 @@ public abstract class OnionProxyManager {
|
|||
|
||||
// Publish the hidden service's onion hostname in transport properties
|
||||
String hostname = new String(FileUtilities.read(hostnameFile), "UTF-8").trim();
|
||||
log.info("Hidden service config has completed.");
|
||||
log.debug("Hidden service config has completed.");
|
||||
|
||||
return hostname;
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ public abstract class OnionProxyManager {
|
|||
if (controlConnection == null) {
|
||||
return;
|
||||
}
|
||||
log.info("Stopping Tor");
|
||||
log.debug("Stopping Tor");
|
||||
controlConnection.setConf("DisableNetwork", "1");
|
||||
controlConnection.shutdownTor("TERM");
|
||||
} finally {
|
||||
|
@ -319,7 +319,7 @@ public abstract class OnionProxyManager {
|
|||
if (controlConnection == null) {
|
||||
throw new RuntimeException("Tor is not running!");
|
||||
}
|
||||
log.info("Enabling network: " + enable);
|
||||
log.debug("Enabling network: " + enable);
|
||||
controlConnection.setConf("DisableNetwork", enable ? "0" : "1");
|
||||
}
|
||||
|
||||
|
@ -390,18 +390,18 @@ public abstract class OnionProxyManager {
|
|||
// then Tor is dead. This assumes, of course, that takeOwnership works
|
||||
// and we can't end up with Zombies.
|
||||
if (controlConnection != null) {
|
||||
log.info("Tor is already running");
|
||||
log.debug("Tor is already running");
|
||||
return true;
|
||||
}
|
||||
|
||||
// The code below is why this method is synchronized, we don't want two
|
||||
// instances of it running at once
|
||||
// as the result would be a mess of screwed up files and connections.
|
||||
log.info("Tor is not running");
|
||||
log.debug("Tor is not running");
|
||||
|
||||
installAndConfigureFiles(useBridges);
|
||||
|
||||
log.info("Starting Tor");
|
||||
log.debug("Starting Tor");
|
||||
File cookieFile = onionProxyContext.getCookieFile();
|
||||
if (cookieFile.getParentFile().exists() == false && cookieFile.getParentFile().mkdirs() == false) {
|
||||
throw new RuntimeException("Could not create cookieFile parent directory");
|
||||
|
@ -536,7 +536,7 @@ public abstract class OnionProxyManager {
|
|||
nextLine.substring(nextLine.lastIndexOf(" ") + 1, nextLine.length() - 1));
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
log.info(nextLine);
|
||||
log.debug(nextLine);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
|
|
@ -165,7 +165,7 @@ public class Node {
|
|||
try {
|
||||
while (running) {
|
||||
final Socket socket = serverSocket.accept();
|
||||
log.info("Accepting Client on port " + socket.getLocalPort());
|
||||
log.debug("Accepting Client on port " + socket.getLocalPort());
|
||||
executorService.submit(new Acceptor(socket));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -237,7 +237,7 @@ public class Node {
|
|||
out = prepareOOSForSocket(socket);
|
||||
objectInputStream = new ObjectInputStream(socket.getInputStream());
|
||||
} catch (EOFException e) {
|
||||
log.info("Got bogus incoming connection");
|
||||
log.debug("Got bogus incoming connection");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
try {
|
||||
|
|
|
@ -30,7 +30,7 @@ public abstract class TorNode<M extends OnionProxyManager, C extends OnionProxyC
|
|||
log.debug("Running Tornode with " + mgr.getClass().getSimpleName() + " and " + ctx.getClass().getSimpleName());
|
||||
tor = initTor(mgr, ctx, useBridges);
|
||||
int proxyPort = tor.getIPv4LocalHostSocksPort();
|
||||
log.info("TorSocks running on port " + proxyPort);
|
||||
log.debug("TorSocks running on port " + proxyPort);
|
||||
this.proxy = setupSocksProxy(proxyPort);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public abstract class TorNode<M extends OnionProxyManager, C extends OnionProxyC
|
|||
try {
|
||||
SocksSocket ssock = new SocksSocket(proxy, onionUrl, port);
|
||||
if (debug)
|
||||
log.info("Took " + (GregorianCalendar.getInstance().getTimeInMillis() - before)
|
||||
log.debug("Took " + (GregorianCalendar.getInstance().getTimeInMillis() - before)
|
||||
+ " milliseconds to connect to " + onionUrl + ":" + port);
|
||||
ssock.setTcpNoDelay(true);
|
||||
return ssock;
|
||||
|
@ -89,7 +89,7 @@ public abstract class TorNode<M extends OnionProxyManager, C extends OnionProxyC
|
|||
|
||||
public HiddenServiceDescriptor createHiddenService(final int localPort, final int servicePort,
|
||||
final HiddenServiceReadyListener listener) throws IOException {
|
||||
log.info("Publishing Hidden Service. This will at least take half a minute...");
|
||||
log.debug("Publishing Hidden Service. This will at least take half a minute...");
|
||||
final String hiddenServiceName = tor.publishHiddenService(servicePort, localPort);
|
||||
final HiddenServiceDescriptor hiddenServiceDescriptor = new HiddenServiceDescriptor(hiddenServiceName,
|
||||
localPort, servicePort);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class Monitor {
|
|||
|
||||
public void shutDown() {
|
||||
gracefulShutDown(() -> {
|
||||
log.info("Shutdown complete");
|
||||
log.debug("Shutdown complete");
|
||||
System.exit(0);
|
||||
});
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public class Monitor {
|
|||
injector.getInstance(P2PService.class).shutDown(() -> {
|
||||
injector.getInstance(WalletService.class).shutDownDone.addListener((ov, o, n) -> {
|
||||
monitorModule.close(injector);
|
||||
log.info("Graceful shutdown completed");
|
||||
log.debug("Graceful shutdown completed");
|
||||
resultHandler.handleResult();
|
||||
});
|
||||
injector.getInstance(WalletService.class).shutDown();
|
||||
|
@ -156,7 +156,7 @@ public class Monitor {
|
|||
UserThread.runAfter(resultHandler::handleResult, 1);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
log.info("App shutdown failed with exception");
|
||||
log.debug("App shutdown failed with exception");
|
||||
t.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
DecryptedMsgWithPubKey decryptedMsgWithPubKey = optionalEncryptionService.get().decryptAndVerify(
|
||||
prefixedSealedAndSignedMessage.sealedAndSigned);
|
||||
|
||||
log.info("\n\nDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\n" +
|
||||
log.debug("\n\nDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\n" +
|
||||
"Decrypted SealedAndSignedMessage:\ndecryptedMsgWithPubKey={}"
|
||||
+ "\nDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\n", decryptedMsgWithPubKey);
|
||||
if (connection.getPeersNodeAddressOptional().isPresent())
|
||||
|
@ -455,12 +455,12 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
else
|
||||
log.error("peersNodeAddress is not available at onMessage.");
|
||||
} else {
|
||||
log.info("Wrong receiverAddressMaskHash. The message is not intended for us.");
|
||||
log.debug("Wrong receiverAddressMaskHash. The message is not intended for us.");
|
||||
}
|
||||
} catch (CryptoException e) {
|
||||
log.info(message.toString());
|
||||
log.info(e.toString());
|
||||
log.info("Decryption of prefixedSealedAndSignedMessage.sealedAndSigned failed. " +
|
||||
log.debug(message.toString());
|
||||
log.debug(e.toString());
|
||||
log.debug("Decryption of prefixedSealedAndSignedMessage.sealedAndSigned failed. " +
|
||||
"That is expected if the message is not intended for us.");
|
||||
}
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
checkArgument(optionalEncryptionService.isPresent(), "EncryptionService not set. Seems that is called on a seed node which must not happen.");
|
||||
checkNotNull(networkNode.getNodeAddress(), "My node address must not be null at doSendEncryptedDirectMessage");
|
||||
try {
|
||||
log.info("\n\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" +
|
||||
log.debug("\n\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" +
|
||||
"Encrypt message:\nmessage={}"
|
||||
+ "\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", message);
|
||||
PrefixedSealedAndSignedMessage prefixedSealedAndSignedMessage = new PrefixedSealedAndSignedMessage(networkNode.getNodeAddress(),
|
||||
|
@ -564,12 +564,12 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
"decryptedMsgWithPubKey.message=", decryptedMsgWithPubKey.message);
|
||||
}
|
||||
} catch (CryptoException e) {
|
||||
log.info(e.toString());
|
||||
log.info("Decryption of prefixedSealedAndSignedMessage.sealedAndSigned failed. " +
|
||||
log.debug(e.toString());
|
||||
log.debug("Decryption of prefixedSealedAndSignedMessage.sealedAndSigned failed. " +
|
||||
"That is expected if the message is not intended for us.");
|
||||
}
|
||||
} else {
|
||||
log.info("Wrong blurredAddressHash. The message is not intended for us.");
|
||||
log.debug("Wrong blurredAddressHash. The message is not intended for us.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
if (isBootstrapped()) {
|
||||
if (!networkNode.getAllConnections().isEmpty()) {
|
||||
try {
|
||||
log.info("\n\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" +
|
||||
log.debug("\n\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n" +
|
||||
"Encrypt message:\nmessage={}"
|
||||
+ "\nEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE\n", message);
|
||||
PrefixedSealedAndSignedMessage prefixedSealedAndSignedMessage = new PrefixedSealedAndSignedMessage(
|
||||
|
@ -611,7 +611,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
|
|||
public void onFailure(@NotNull Throwable throwable) {
|
||||
log.trace("SendEncryptedMailboxMessage onFailure");
|
||||
log.debug(throwable.toString());
|
||||
log.info("We cannot send message to peer. Peer might be offline. We will store message in mailbox.");
|
||||
log.debug("We cannot send message to peer. Peer might be offline. We will store message in mailbox.");
|
||||
log.trace("create MailboxEntry with peerAddress " + peersNodeAddress);
|
||||
PublicKey receiverStoragePublicKey = peersPubKeyRing.getSignaturePubKey();
|
||||
addMailboxData(new MailboxStoragePayload(prefixedSealedAndSignedMessage,
|
||||
|
|
|
@ -174,7 +174,7 @@ public class Connection implements MessageListener {
|
|||
if (!stopped) {
|
||||
if (!isCapabilityRequired(message) || isCapabilitySupported(message)) {
|
||||
try {
|
||||
log.info("sendMessage message=" + Utilities.toTruncatedString(message));
|
||||
log.error("sendMessage message=" + Utilities.toTruncatedString(message));
|
||||
Log.traceCall();
|
||||
|
||||
// Throttle outbound messages
|
||||
|
@ -201,13 +201,13 @@ public class Connection implements MessageListener {
|
|||
} else if (message instanceof PrefixedSealedAndSignedMessage && peersNodeAddressOptional.isPresent()) {
|
||||
setPeerType(Connection.PeerType.DIRECT_MSG_PEER);
|
||||
|
||||
log.info("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" +
|
||||
log.debug("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" +
|
||||
"Sending direct message to peer" +
|
||||
"Write object to outputStream to peer: {} (uid={})\ntruncated message={} / size={}" +
|
||||
"\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
|
||||
peersNodeAddress, uid, Utilities.toTruncatedString(message), size);
|
||||
} else {
|
||||
log.info("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" +
|
||||
log.debug("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" +
|
||||
"Write object to outputStream to peer: {} (uid={})\ntruncated message={} / size={}" +
|
||||
"\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
|
||||
peersNodeAddress, uid, Utilities.toTruncatedString(message), size);
|
||||
|
@ -370,7 +370,7 @@ public class Connection implements MessageListener {
|
|||
|
||||
String peersNodeAddress = getPeersNodeAddressOptional().isPresent() ? getPeersNodeAddressOptional().get().getFullAddress() : "";
|
||||
if (this instanceof InboundConnection) {
|
||||
log.info("\n\n############################################################\n" +
|
||||
log.debug("\n\n############################################################\n" +
|
||||
"We got the peers node address set.\n" +
|
||||
"peersNodeAddress= " + peersNodeAddress +
|
||||
"\nconnection.uid=" + getUid() +
|
||||
|
@ -435,7 +435,7 @@ public class Connection implements MessageListener {
|
|||
Log.traceCall(this.toString());
|
||||
if (!stopped) {
|
||||
String peersNodeAddress = peersNodeAddressOptional.isPresent() ? peersNodeAddressOptional.get().toString() : "null";
|
||||
log.info("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"ShutDown connection:"
|
||||
+ "\npeersNodeAddress=" + peersNodeAddress
|
||||
+ "\ncloseConnectionReason=" + closeConnectionReason
|
||||
|
@ -749,7 +749,7 @@ public class Connection implements MessageListener {
|
|||
} else if (rawInputObject instanceof Message) {
|
||||
// We want to log all incoming messages (except Pong and RefreshTTLMessage)
|
||||
// so we log before the data type checks
|
||||
log.info("size={}; object={}", size, Utilities.toTruncatedString(rawInputObject.toString(), 100));
|
||||
log.error("size={}; object={}", size, Utilities.toTruncatedString(rawInputObject.toString(), 100));
|
||||
log.debug("\n\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n" +
|
||||
"New data arrived at inputHandler of connection {}.\n" +
|
||||
"Received object (truncated)={} / size={}"
|
||||
|
@ -836,7 +836,7 @@ public class Connection implements MessageListener {
|
|||
|
||||
if (message instanceof CloseConnectionMessage) {
|
||||
// If we get a CloseConnectionMessage we shut down
|
||||
log.info("CloseConnectionMessage received. Reason={}\n\t" +
|
||||
log.debug("CloseConnectionMessage received. Reason={}\n\t" +
|
||||
"connection={}", ((CloseConnectionMessage) message).reason, connection);
|
||||
stop();
|
||||
if (CloseConnectionReason.PEER_BANNED.name().equals(((CloseConnectionMessage) message).reason)) {
|
||||
|
|
|
@ -91,7 +91,7 @@ public class LocalhostNetworkNode extends NetworkNode {
|
|||
long ts = System.currentTimeMillis();
|
||||
if (simulateTorDelayTorNode > 0)
|
||||
Uninterruptibles.sleepUninterruptibly(simulateTorDelayTorNode, TimeUnit.MILLISECONDS);
|
||||
log.info("\n\n############################################################\n" +
|
||||
log.debug("\n\n############################################################\n" +
|
||||
"TorNode created [simulation]:" +
|
||||
"\nTook " + (System.currentTimeMillis() - ts) + " ms"
|
||||
+ "\n############################################################\n");
|
||||
|
@ -120,7 +120,7 @@ public class LocalhostNetworkNode extends NetworkNode {
|
|||
long ts = System.currentTimeMillis();
|
||||
if (simulateTorDelayHiddenService > 0)
|
||||
Uninterruptibles.sleepUninterruptibly(simulateTorDelayHiddenService, TimeUnit.MILLISECONDS);
|
||||
log.info("\n\n############################################################\n" +
|
||||
log.debug("\n\n############################################################\n" +
|
||||
"Hidden service published [simulation]:" +
|
||||
"\nTook " + (System.currentTimeMillis() - ts) + " ms"
|
||||
+ "\n############################################################\n");
|
||||
|
|
|
@ -75,7 +75,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
if (connection != null) {
|
||||
return sendMessage(connection, message);
|
||||
} else {
|
||||
log.info("We have not found any connection for peerAddress {}.\n\t" +
|
||||
log.debug("We have not found any connection for peerAddress {}.\n\t" +
|
||||
"We will create a new outbound connection.", peersNodeAddress);
|
||||
|
||||
final SettableFuture<Connection> resultFuture = SettableFuture.create();
|
||||
|
@ -85,10 +85,10 @@ public abstract class NetworkNode implements MessageListener {
|
|||
try {
|
||||
// can take a while when using tor
|
||||
long startTs = System.currentTimeMillis();
|
||||
log.info("Start create socket to peersNodeAddress {}", peersNodeAddress.getFullAddress());
|
||||
log.debug("Start create socket to peersNodeAddress {}", peersNodeAddress.getFullAddress());
|
||||
Socket socket = createSocket(peersNodeAddress);
|
||||
long duration = System.currentTimeMillis() - startTs;
|
||||
log.info("Socket creation to peersNodeAddress {} took {} ms", peersNodeAddress.getFullAddress(),
|
||||
log.debug("Socket creation to peersNodeAddress {} took {} ms", peersNodeAddress.getFullAddress(),
|
||||
duration);
|
||||
|
||||
if (duration > CREATE_SOCKET_TIMEOUT_MILLIS)
|
||||
|
@ -101,7 +101,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
existingConnection = getOutboundConnection(peersNodeAddress);
|
||||
|
||||
if (existingConnection != null) {
|
||||
log.info("We found in the meantime a connection for peersNodeAddress {}, " +
|
||||
log.debug("We found in the meantime a connection for peersNodeAddress {}, " +
|
||||
"so we use that for sending the message.\n" +
|
||||
"That can happen if Tor needs long for creating a new outbound connection.\n" +
|
||||
"We might have got a new inbound or outbound connection.",
|
||||
|
@ -141,7 +141,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
}
|
||||
}, peersNodeAddress);
|
||||
|
||||
log.info("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"NetworkNode created new outbound connection:"
|
||||
+ "\nmyNodeAddress=" + getNodeAddress()
|
||||
+ "\npeersNodeAddress=" + peersNodeAddress
|
||||
|
@ -278,7 +278,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
}
|
||||
|
||||
getAllConnections().stream().forEach(c -> c.shutDown(CloseConnectionReason.APP_SHUT_DOWN));
|
||||
log.info("NetworkNode shutdown complete");
|
||||
log.debug("NetworkNode shutdown complete");
|
||||
}
|
||||
if (shutDownCompleteHandler != null) shutDownCompleteHandler.run();
|
||||
}
|
||||
|
|
|
@ -39,13 +39,13 @@ class Server implements Runnable {
|
|||
Thread.currentThread().setName("Server-" + serverSocket.getLocalPort());
|
||||
try {
|
||||
while (!stopped && !Thread.currentThread().isInterrupted()) {
|
||||
log.info("Ready to accept new clients on port " + serverSocket.getLocalPort());
|
||||
log.debug("Ready to accept new clients on port " + serverSocket.getLocalPort());
|
||||
final Socket socket = serverSocket.accept();
|
||||
if (!stopped && !Thread.currentThread().isInterrupted()) {
|
||||
log.info("Accepted new client on localPort/port " + socket.getLocalPort() + "/" + socket.getPort());
|
||||
log.debug("Accepted new client on localPort/port " + socket.getLocalPort() + "/" + socket.getPort());
|
||||
InboundConnection connection = new InboundConnection(socket, messageListener, connectionListener);
|
||||
|
||||
log.info("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"Server created new inbound connection:"
|
||||
+ "\nlocalPort/port=" + serverSocket.getLocalPort()
|
||||
+ "/" + socket.getPort()
|
||||
|
@ -78,12 +78,12 @@ class Server implements Runnable {
|
|||
try {
|
||||
serverSocket.close();
|
||||
} catch (SocketException e) {
|
||||
log.warn("SocketException at shutdown might be expected " + e.getMessage());
|
||||
log.debug("SocketException at shutdown might be expected " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
log.error("Exception at shutdown. " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
log.info("Server shutdown complete");
|
||||
log.debug("Server shutdown complete");
|
||||
}
|
||||
} else {
|
||||
log.warn("stopped already called ast shutdown");
|
||||
|
|
|
@ -121,7 +121,7 @@ public class TorNetworkNode extends NetworkNode {
|
|||
try {
|
||||
MoreExecutors.shutdownAndAwaitTermination(executorService, 500, TimeUnit.MILLISECONDS);
|
||||
log.debug("Shutdown executorService done after " + (System.currentTimeMillis() - ts) + " ms.");
|
||||
log.info("Shutdown completed");
|
||||
log.debug("Shutdown completed");
|
||||
} catch (Throwable t) {
|
||||
log.error("Shutdown executorService failed with exception: " + t.getMessage());
|
||||
t.printStackTrace();
|
||||
|
@ -138,11 +138,11 @@ public class TorNetworkNode extends NetworkNode {
|
|||
executorService.submit(() -> {
|
||||
Utilities.setThreadName("torNetworkNodeShutDown");
|
||||
long ts = System.currentTimeMillis();
|
||||
log.info("Shutdown torNetworkNode");
|
||||
log.debug("Shutdown torNetworkNode");
|
||||
try {
|
||||
if (torNetworkNode != null)
|
||||
torNetworkNode.shutdown();
|
||||
log.info("Shutdown torNetworkNode done after " + (System.currentTimeMillis() - ts) + " ms.");
|
||||
log.debug("Shutdown torNetworkNode done after " + (System.currentTimeMillis() - ts) + " ms.");
|
||||
} catch (Throwable e) {
|
||||
log.error("Shutdown torNetworkNode failed with exception: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
|
@ -221,7 +221,7 @@ public class TorNetworkNode extends NetworkNode {
|
|||
if (torDir.mkdirs())
|
||||
log.trace("Created directory for tor at {}", torDir.getAbsolutePath());
|
||||
TorNode<JavaOnionProxyManager, JavaOnionProxyContext> torNode = new JavaTorNode(torDir, useBridges);
|
||||
log.info("\n\n############################################################\n" +
|
||||
log.debug("\n\n############################################################\n" +
|
||||
"TorNode created:" +
|
||||
"\nTook " + (System.currentTimeMillis() - ts) + " ms"
|
||||
+ "\n############################################################\n");
|
||||
|
@ -250,7 +250,7 @@ public class TorNetworkNode extends NetworkNode {
|
|||
long ts = System.currentTimeMillis();
|
||||
HiddenServiceDescriptor hiddenServiceDescriptor = torNode.createHiddenService(localPort, servicePort);
|
||||
torNode.addHiddenServiceReadyListener(hiddenServiceDescriptor, descriptor -> {
|
||||
log.info("\n\n############################################################\n" +
|
||||
log.debug("\n\n############################################################\n" +
|
||||
"Hidden service published:" +
|
||||
"\nAddress=" + descriptor.getFullAddress() +
|
||||
"\nTook " + (System.currentTimeMillis() - ts) + " ms"
|
||||
|
|
|
@ -126,7 +126,7 @@ public class BroadcastHandler implements PeerManager.Listener {
|
|||
onFault(errorMessage, false);
|
||||
}, timeoutDelay);
|
||||
|
||||
log.info("Broadcast message to {} peers out of {} total connected peers.", numOfPeers, connectedPeersSet.size());
|
||||
log.debug("Broadcast message to {} peers out of {} total connected peers.", numOfPeers, connectedPeersSet.size());
|
||||
for (int i = 0; i < numOfPeers; i++) {
|
||||
if (stopped)
|
||||
break; // do not continue sending after a timeout or a cancellation
|
||||
|
@ -181,7 +181,7 @@ public class BroadcastHandler implements PeerManager.Listener {
|
|||
public void onFailure(@NotNull Throwable throwable) {
|
||||
numOfFailedBroadcasts++;
|
||||
if (!stopped) {
|
||||
log.info("Broadcast to " + nodeAddress + " failed.\n\t" +
|
||||
log.debug("Broadcast to " + nodeAddress + " failed.\n\t" +
|
||||
"ErrorMessage=" + throwable.getMessage());
|
||||
if (numOfCompletedBroadcasts + numOfFailedBroadcasts == numOfPeers)
|
||||
onFault("stopped at onFailure: " + errorMessage);
|
||||
|
@ -241,7 +241,7 @@ public class BroadcastHandler implements PeerManager.Listener {
|
|||
if (logWarning)
|
||||
log.warn(errorMessage);
|
||||
else
|
||||
log.trace(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
|
||||
if (listener != null)
|
||||
listener.onBroadcastFailed(errorMessage);
|
||||
|
|
|
@ -97,7 +97,7 @@ public class PeerManager implements ConnectionListener {
|
|||
dbStorage = new Storage<>(storageDir);
|
||||
HashSet<Peer> persistedPeers = dbStorage.initAndGetPersistedWithFileName("PersistedPeers");
|
||||
if (persistedPeers != null) {
|
||||
log.info("We have persisted reported peers. persistedPeers.size()=" + persistedPeers.size());
|
||||
log.debug("We have persisted reported peers. persistedPeers.size()=" + persistedPeers.size());
|
||||
this.persistedPeers.addAll(persistedPeers);
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class PeerManager implements ConnectionListener {
|
|||
@Override
|
||||
public void onMissedSecondTick(long missed) {
|
||||
if (missed > Clock.IDLE_TOLERANCE) {
|
||||
log.warn("We have been in standby mode for {} sec", missed / 1000);
|
||||
log.info("We have been in standby mode for {} sec", missed / 1000);
|
||||
stopped = false;
|
||||
listeners.stream().forEach(Listener::onAwakeFromStandby);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public class PeerManager implements ConnectionListener {
|
|||
final boolean seedNode = isSeedNode(connection);
|
||||
|
||||
final Optional<NodeAddress> addressOptional = connection.getPeersNodeAddressOptional();
|
||||
log.warn("++ Connection created: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "unknown address"), seedNode ? " (SeedNode)" : "");
|
||||
log.info("++ Connection created: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "unknown address"), seedNode ? " (SeedNode)" : "");
|
||||
|
||||
|
||||
if (seedNode)
|
||||
|
@ -185,7 +185,7 @@ public class PeerManager implements ConnectionListener {
|
|||
" / closeConnectionReason: " + closeConnectionReason);
|
||||
|
||||
final Optional<NodeAddress> addressOptional = connection.getPeersNodeAddressOptional();
|
||||
log.warn("-- Connection closed: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "unknown address"), isSeedNode(connection) ? " (SeedNode)" : "");
|
||||
log.info("-- Connection closed: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "unknown address"), isSeedNode(connection) ? " (SeedNode)" : "");
|
||||
|
||||
handleConnectionFault(connection);
|
||||
|
||||
|
@ -239,10 +239,10 @@ public class PeerManager implements ConnectionListener {
|
|||
Log.traceCall("limit=" + limit);
|
||||
Set<Connection> allConnections = networkNode.getAllConnections();
|
||||
int size = allConnections.size();
|
||||
log.info("We have {} connections open. Our limit is {}", size, limit);
|
||||
log.debug("We have {} connections open. Our limit is {}", size, limit);
|
||||
|
||||
if (size > limit) {
|
||||
log.info("We have too many connections open.\n\t" +
|
||||
log.debug("We have too many connections open.\n\t" +
|
||||
"Lets try first to remove the inbound connections of type PEER.");
|
||||
List<Connection> candidates = allConnections.stream()
|
||||
.filter(e -> e instanceof InboundConnection)
|
||||
|
@ -250,28 +250,28 @@ public class PeerManager implements ConnectionListener {
|
|||
.collect(Collectors.toList());
|
||||
|
||||
if (candidates.size() == 0) {
|
||||
log.info("No candidates found. We check if we exceed our " +
|
||||
log.debug("No candidates found. We check if we exceed our " +
|
||||
"maxConnectionsPeer limit of {}", maxConnectionsPeer);
|
||||
if (size > maxConnectionsPeer) {
|
||||
log.info("Lets try to remove ANY connection of type PEER.");
|
||||
log.debug("Lets try to remove ANY connection of type PEER.");
|
||||
candidates = allConnections.stream()
|
||||
.filter(e -> e.getPeerType() == Connection.PeerType.PEER)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (candidates.size() == 0) {
|
||||
log.info("No candidates found. We check if we exceed our " +
|
||||
log.debug("No candidates found. We check if we exceed our " +
|
||||
"maxConnectionsNonDirect limit of {}", maxConnectionsNonDirect);
|
||||
if (size > maxConnectionsNonDirect) {
|
||||
log.info("Lets try to remove any connection which is not of type DIRECT_MSG_PEER.");
|
||||
log.debug("Lets try to remove any connection which is not of type DIRECT_MSG_PEER.");
|
||||
candidates = allConnections.stream()
|
||||
.filter(e -> e.getPeerType() != Connection.PeerType.DIRECT_MSG_PEER)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (candidates.size() == 0) {
|
||||
log.info("No candidates found. We check if we exceed our " +
|
||||
log.debug("No candidates found. We check if we exceed our " +
|
||||
"maxConnectionsAbsolute limit of {}", maxConnectionsAbsolute);
|
||||
if (size > maxConnectionsAbsolute) {
|
||||
log.info("Lets try to remove any connection.");
|
||||
log.debug("Lets try to remove any connection.");
|
||||
candidates = allConnections.stream().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -282,9 +282,9 @@ public class PeerManager implements ConnectionListener {
|
|||
|
||||
if (candidates.size() > 0) {
|
||||
candidates.sort((o1, o2) -> ((Long) o1.getStatistic().getLastActivityTimestamp()).compareTo(((Long) o2.getStatistic().getLastActivityTimestamp())));
|
||||
log.info("Candidates.size() for shut down=" + candidates.size());
|
||||
log.debug("Candidates.size() for shut down=" + candidates.size());
|
||||
Connection connection = candidates.remove(0);
|
||||
log.info("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
|
||||
log.debug("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
|
||||
if (!connection.isStopped())
|
||||
connection.shutDown(CloseConnectionReason.TOO_MANY_CONNECTIONS_OPEN, () -> checkMaxConnections(limit));
|
||||
return true;
|
||||
|
@ -307,7 +307,7 @@ public class PeerManager implements ConnectionListener {
|
|||
.forEach(connection -> UserThread.runAfter(() -> {
|
||||
// We give 30 seconds delay and check again if still no address is set
|
||||
if (!connection.hasPeersNodeAddress() && !connection.isStopped()) {
|
||||
log.info("We close the connection as the peer address is still unknown.\n\t" +
|
||||
log.debug("We close the connection as the peer address is still unknown.\n\t" +
|
||||
"connection=" + connection);
|
||||
connection.shutDown(CloseConnectionReason.UNKNOWN_PEER_ADDRESS);
|
||||
}
|
||||
|
@ -325,9 +325,9 @@ public class PeerManager implements ConnectionListener {
|
|||
|
||||
if (candidates.size() > 1) {
|
||||
candidates.sort((o1, o2) -> ((Long) o1.getStatistic().getLastActivityTimestamp()).compareTo(((Long) o2.getStatistic().getLastActivityTimestamp())));
|
||||
log.info("Number of connections exceeding MAX_CONNECTIONS_EXTENDED_1. Current size=" + candidates.size());
|
||||
log.debug("Number of connections exceeding MAX_CONNECTIONS_EXTENDED_1. Current size=" + candidates.size());
|
||||
Connection connection = candidates.remove(0);
|
||||
log.info("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
|
||||
log.debug("We are going to shut down the oldest connection.\n\tconnection=" + connection.toString());
|
||||
connection.shutDown(CloseConnectionReason.TOO_MANY_SEED_NODES_CONNECTED, this::removeSuperfluousSeedNodes);
|
||||
}
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ public class PeerManager implements ConnectionListener {
|
|||
result.append("\n------------------------------------------------------------\n");
|
||||
log.debug(result.toString());
|
||||
}
|
||||
log.info("Number of collected reported peers: {}", reportedPeers.size());
|
||||
log.debug("Number of collected reported peers: {}", reportedPeers.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -434,7 +434,7 @@ public class PeerManager implements ConnectionListener {
|
|||
reportedPeersClone.stream().forEach(e -> result.append("\n\t").append(e));
|
||||
log.debug(result.toString());
|
||||
}
|
||||
log.info("Number of new arrived reported peers: {}", reportedPeers.size());
|
||||
log.debug("Number of new arrived reported peers: {}", reportedPeers.size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -612,7 +612,7 @@ public class PeerManager implements ConnectionListener {
|
|||
networkNode.getConfirmedConnections().stream().forEach(e -> result.append("\n")
|
||||
.append(e.getPeersNodeAddressOptional().get()).append(" ").append(e.getPeerType()));
|
||||
result.append("\n------------------------------------------------------------\n");
|
||||
log.info(result.toString());
|
||||
log.debug(result.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ public class GetDataRequestHandler {
|
|||
|
||||
private void handleFault(String errorMessage, CloseConnectionReason closeConnectionReason, Connection connection) {
|
||||
if (!stopped) {
|
||||
log.info(errorMessage + "\n\tcloseConnectionReason=" + closeConnectionReason);
|
||||
log.debug(errorMessage + "\n\tcloseConnectionReason=" + closeConnectionReason);
|
||||
cleanup();
|
||||
listener.onFault(errorMessage, connection);
|
||||
} else {
|
||||
|
|
|
@ -94,7 +94,7 @@ public class RequestDataHandler implements MessageListener {
|
|||
if (!stopped) {
|
||||
String errorMessage = "A timeout occurred at sending getDataRequest:" + getDataRequest +
|
||||
" on nodeAddress:" + nodeAddress;
|
||||
log.info(errorMessage + " / RequestDataHandler=" + RequestDataHandler.this);
|
||||
log.debug(errorMessage + " / RequestDataHandler=" + RequestDataHandler.this);
|
||||
handleFault(errorMessage, nodeAddress, CloseConnectionReason.SEND_MSG_TIMEOUT);
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that timeoutTimer.run call. " +
|
||||
|
@ -104,7 +104,7 @@ public class RequestDataHandler implements MessageListener {
|
|||
TIME_OUT_SEC);
|
||||
}
|
||||
|
||||
log.info("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);
|
||||
log.debug("We send a {} to peer {}. ", getDataRequest.getClass().getSimpleName(), nodeAddress);
|
||||
SettableFuture<Connection> future = networkNode.sendMessage(nodeAddress, getDataRequest);
|
||||
Futures.addCallback(future, new FutureCallback<Connection>() {
|
||||
@Override
|
||||
|
@ -126,7 +126,7 @@ public class RequestDataHandler implements MessageListener {
|
|||
" failed. That is expected if the peer is offline.\n\t" +
|
||||
"getDataRequest=" + getDataRequest + "." +
|
||||
"\n\tException=" + throwable.getMessage();
|
||||
log.info(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
handleFault(errorMessage, nodeAddress, CloseConnectionReason.SEND_MSG_FAILURE);
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call. " +
|
||||
|
@ -161,7 +161,7 @@ public class RequestDataHandler implements MessageListener {
|
|||
});
|
||||
StringBuilder sb = new StringBuilder("Received data size: ").append(getDataResponse.dataSet.size()).append(", data items: ");
|
||||
payloadByClassName.entrySet().stream().forEach(e -> sb.append(e.getValue().size()).append("items of ").append(e.getKey()).append("; "));
|
||||
log.info(sb.toString());
|
||||
log.debug(sb.toString());
|
||||
|
||||
if (getDataResponse.requestNonce == nonce) {
|
||||
stopTimeoutTimer();
|
||||
|
|
|
@ -277,13 +277,13 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
|
|||
handlerMap.remove(nodeAddress);
|
||||
|
||||
if (!remainingNodeAddresses.isEmpty()) {
|
||||
log.info("There are remaining nodes available for requesting data. " +
|
||||
log.debug("There are remaining nodes available for requesting data. " +
|
||||
"We will try requestDataFromPeers again.");
|
||||
NodeAddress nextCandidate = remainingNodeAddresses.get(0);
|
||||
remainingNodeAddresses.remove(nextCandidate);
|
||||
requestData(nextCandidate, remainingNodeAddresses);
|
||||
} else {
|
||||
log.info("There is no remaining node available for requesting data. " +
|
||||
log.debug("There is no remaining node available for requesting data. " +
|
||||
"That is expected if no other node is online.\n\t" +
|
||||
"We will try to use reported peers (if no available we use persisted peers) " +
|
||||
"and try again to request data from our seed nodes after a random pause.");
|
||||
|
|
|
@ -100,7 +100,7 @@ class KeepAliveHandler implements MessageListener {
|
|||
String errorMessage = "Sending ping to " + connection +
|
||||
" failed. That is expected if the peer is offline.\n\tping=" + ping +
|
||||
".\n\tException=" + throwable.getMessage();
|
||||
log.info(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
cleanup();
|
||||
//peerManager.shutDownConnection(connection, CloseConnectionReason.SEND_MSG_FAILURE);
|
||||
peerManager.handleConnectionFault(connection);
|
||||
|
|
|
@ -93,7 +93,7 @@ public class KeepAliveManager implements MessageListener, ConnectionListener, Pe
|
|||
String errorMessage = "Sending pong to " + connection +
|
||||
" failed. That is expected if the peer is offline. pong=" + pong + "." +
|
||||
"Exception: " + throwable.getMessage();
|
||||
log.info(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
peerManager.handleConnectionFault(connection);
|
||||
} else {
|
||||
log.warn("We have stopped already. We ignore that networkNode.sendMessage.onFailure call.");
|
||||
|
@ -200,7 +200,7 @@ public class KeepAliveManager implements MessageListener, ConnectionListener, Pe
|
|||
});
|
||||
|
||||
int size = handlerMap.size();
|
||||
log.info("handlerMap size=" + size);
|
||||
log.debug("handlerMap size=" + size);
|
||||
if (size > peerManager.getMaxConnections())
|
||||
log.warn("Seems we didn't clean up out map correctly.\n" +
|
||||
"handlerMap size={}, peerManager.getMaxConnections()={}", size, peerManager.getMaxConnections());
|
||||
|
|
|
@ -75,9 +75,9 @@ class GetPeersRequestHandler {
|
|||
timeoutTimer = UserThread.runAfter(() -> { // setup before sending to avoid race conditions
|
||||
if (!stopped) {
|
||||
String errorMessage = "A timeout occurred at sending getPeersResponse:" + getPeersResponse + " on connection:" + connection;
|
||||
log.info(errorMessage + " / PeerExchangeHandshake=" +
|
||||
log.debug(errorMessage + " / PeerExchangeHandshake=" +
|
||||
GetPeersRequestHandler.this);
|
||||
log.info("timeoutTimer called. this=" + this);
|
||||
log.debug("timeoutTimer called. this=" + this);
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, connection);
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that timeoutTimer.run call.");
|
||||
|
@ -105,7 +105,7 @@ class GetPeersRequestHandler {
|
|||
String errorMessage = "Sending getPeersResponse to " + connection +
|
||||
" failed. That is expected if the peer is offline. getPeersResponse=" + getPeersResponse + "." +
|
||||
"Exception: " + throwable.getMessage();
|
||||
log.info(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, connection);
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that networkNode.sendMessage.onFailure call.");
|
||||
|
|
|
@ -89,9 +89,9 @@ class PeerExchangeHandler implements MessageListener {
|
|||
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=" +
|
||||
log.debug(errorMessage + " / PeerExchangeHandler=" +
|
||||
PeerExchangeHandler.this);
|
||||
log.info("timeoutTimer called on " + this);
|
||||
log.debug("timeoutTimer called on " + this);
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_TIMEOUT, nodeAddress);
|
||||
} else {
|
||||
log.trace("We have stopped that handler already. We ignore that timeoutTimer.run call.");
|
||||
|
@ -125,7 +125,7 @@ class PeerExchangeHandler implements MessageListener {
|
|||
String errorMessage = "Sending getPeersRequest to " + nodeAddress +
|
||||
" failed. That is expected if the peer is offline.\n\tgetPeersRequest=" + getPeersRequest +
|
||||
".\n\tException=" + throwable.getMessage();
|
||||
log.info(errorMessage);
|
||||
log.debug(errorMessage);
|
||||
handleFault(errorMessage, CloseConnectionReason.SEND_MSG_FAILURE, nodeAddress);
|
||||
} else {
|
||||
log.trace("We have stopped that handler already. We ignore that sendGetPeersRequest.onFailure call.");
|
||||
|
|
|
@ -202,17 +202,17 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
|
|||
handlerMap.remove(nodeAddress);
|
||||
if (!remainingNodeAddresses.isEmpty()) {
|
||||
if (!peerManager.hasSufficientConnections()) {
|
||||
log.info("There are remaining nodes available for requesting peers. " +
|
||||
log.debug("There are remaining nodes available for requesting peers. " +
|
||||
"We will try getReportedPeers again.");
|
||||
NodeAddress nextCandidate = remainingNodeAddresses.get(new Random().nextInt(remainingNodeAddresses.size()));
|
||||
remainingNodeAddresses.remove(nextCandidate);
|
||||
requestReportedPeers(nextCandidate, remainingNodeAddresses);
|
||||
} else {
|
||||
// That path will rarely be reached
|
||||
log.info("We have already sufficient connections.");
|
||||
log.debug("We have already sufficient connections.");
|
||||
}
|
||||
} else {
|
||||
log.info("There is no remaining node available for requesting peers. " +
|
||||
log.debug("There is no remaining node available for requesting peers. " +
|
||||
"That is expected if no other node is online.\n\t" +
|
||||
"We will try again after a pause.");
|
||||
if (retryTimer == null)
|
||||
|
@ -259,7 +259,7 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
|
|||
Collections.shuffle(filteredSeedNodeAddresses);
|
||||
list.addAll(filteredSeedNodeAddresses);
|
||||
|
||||
log.info("Number of peers in list for connectToMorePeers: {}", list.size());
|
||||
log.debug("Number of peers in list for connectToMorePeers: {}", list.size());
|
||||
log.trace("Filtered connectToMorePeers list: list=" + list);
|
||||
if (!list.isEmpty()) {
|
||||
// Dont shuffle as we want the seed nodes at the last entries
|
||||
|
@ -267,7 +267,7 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
|
|||
list.remove(nextCandidate);
|
||||
requestReportedPeers(nextCandidate, list);
|
||||
} else {
|
||||
log.info("No more peers are available for requestReportedPeers. We will try again after a pause.");
|
||||
log.debug("No more peers are available for requestReportedPeers. We will try again after a pause.");
|
||||
if (retryTimer == null)
|
||||
retryTimer = UserThread.runAfter(() -> {
|
||||
if (!stopped) {
|
||||
|
@ -281,7 +281,7 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener,
|
|||
}, RETRY_DELAY_SEC);
|
||||
}
|
||||
} else {
|
||||
log.info("We have already sufficient connections.");
|
||||
log.debug("We have already sufficient connections.");
|
||||
}
|
||||
} else {
|
||||
log.trace("We have stopped already. We ignore that requestWithAvailablePeers call.");
|
||||
|
|
|
@ -87,7 +87,7 @@ public class SeedNodesRepository {
|
|||
.filter(e -> String.valueOf(e.port).endsWith(networkIdAsString))
|
||||
.filter(e -> !e.equals(nodeAddressToExclude))
|
||||
.collect(Collectors.toSet());
|
||||
log.info("SeedNodeAddresses (useLocalhost={}) for networkId {}:\nnetworkId={}", useLocalhost, networkId, filtered);
|
||||
log.debug("SeedNodeAddresses (useLocalhost={}) for networkId {}:\nnetworkId={}", useLocalhost, networkId, filtered);
|
||||
return filtered;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
|||
ByteArray hashOfPayload = entry.getKey();
|
||||
ProtectedStorageEntry protectedStorageEntry = map.get(hashOfPayload);
|
||||
toRemoveSet.add(protectedStorageEntry);
|
||||
log.info("We found an expired data entry. We remove the protectedData:\n\t" + Utilities.toTruncatedString(protectedStorageEntry));
|
||||
log.debug("We found an expired data entry. We remove the protectedData:\n\t" + Utilities.toTruncatedString(protectedStorageEntry));
|
||||
map.remove(hashOfPayload);
|
||||
});
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
|||
ByteArray hashOfPayload = getHashAsByteArray(expirablePayload);
|
||||
boolean containsKey = map.containsKey(hashOfPayload);
|
||||
if (containsKey) {
|
||||
log.info("We remove the data as the data owner got disconnected with " +
|
||||
log.debug("We remove the data as the data owner got disconnected with " +
|
||||
"closeConnectionReason=" + closeConnectionReason);
|
||||
|
||||
Log.logIfStressTests("We remove the data as the data owner got disconnected with " +
|
||||
|
@ -596,7 +596,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
|||
});
|
||||
sb.append("\n------------------------------------------------------------\n");
|
||||
log.debug(sb.toString());
|
||||
log.info("Data set " + info + " operation: size=" + map.values().size());
|
||||
log.debug("Data set " + info + " operation: size=" + map.values().size());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,28 +82,28 @@ public class DummySeedNode {
|
|||
arg = arg.substring(NetworkOptionKeys.MY_ADDRESS.length() + 1);
|
||||
checkArgument(arg.contains(":") && arg.split(":").length == 2 && arg.split(":")[1].length() > 3, "Wrong program argument: " + arg);
|
||||
mySeedNodeAddress = new NodeAddress(arg);
|
||||
log.info("From processArgs: mySeedNodeAddress=" + mySeedNodeAddress);
|
||||
log.debug("From processArgs: mySeedNodeAddress=" + mySeedNodeAddress);
|
||||
} else if (arg.startsWith(NetworkOptionKeys.NETWORK_ID)) {
|
||||
arg = arg.substring(NetworkOptionKeys.NETWORK_ID.length() + 1);
|
||||
networkId = Integer.parseInt(arg);
|
||||
log.info("From processArgs: networkId=" + networkId);
|
||||
log.debug("From processArgs: networkId=" + networkId);
|
||||
checkArgument(networkId > -1 && networkId < 3,
|
||||
"networkId out of scope (Mainnet = 0, TestNet = 1, Regtest = 2)");
|
||||
Version.setBtcNetworkId(networkId);
|
||||
} else if (arg.startsWith(NetworkOptionKeys.MAX_CONNECTIONS)) {
|
||||
arg = arg.substring(NetworkOptionKeys.MAX_CONNECTIONS.length() + 1);
|
||||
maxConnections = Integer.parseInt(arg);
|
||||
log.info("From processArgs: maxConnections=" + maxConnections);
|
||||
log.debug("From processArgs: maxConnections=" + maxConnections);
|
||||
checkArgument(maxConnections < MAX_CONNECTIONS_LIMIT, "maxConnections seems to be a bit too high...");
|
||||
} else if (arg.startsWith(NetworkOptionKeys.USE_LOCALHOST)) {
|
||||
arg = arg.substring(NetworkOptionKeys.USE_LOCALHOST.length() + 1);
|
||||
checkArgument(arg.equals("true") || arg.equals("false"));
|
||||
useLocalhost = ("true").equals(arg);
|
||||
log.info("From processArgs: useLocalhost=" + useLocalhost);
|
||||
log.debug("From processArgs: useLocalhost=" + useLocalhost);
|
||||
} else if (arg.startsWith(CommonOptionKeys.LOG_LEVEL_KEY)) {
|
||||
arg = arg.substring(CommonOptionKeys.LOG_LEVEL_KEY.length() + 1);
|
||||
logLevel = Level.toLevel(arg.toUpperCase());
|
||||
log.info("From processArgs: logLevel=" + logLevel);
|
||||
log.debug("From processArgs: logLevel=" + logLevel);
|
||||
} else if (arg.startsWith(SEED_NODES_LIST)) {
|
||||
arg = arg.substring(SEED_NODES_LIST.length() + 1);
|
||||
checkArgument(arg.contains(":") && arg.split(":").length > 1 && arg.split(":")[1].length() > 3,
|
||||
|
@ -115,7 +115,7 @@ public class DummySeedNode {
|
|||
"Wrong program argument " + e);
|
||||
progArgSeedNodes.add(new NodeAddress(e));
|
||||
});
|
||||
log.info("From processArgs: progArgSeedNodes=" + progArgSeedNodes);
|
||||
log.debug("From processArgs: progArgSeedNodes=" + progArgSeedNodes);
|
||||
progArgSeedNodes.remove(mySeedNodeAddress);
|
||||
} else if (arg.startsWith(NetworkOptionKeys.BAN_LIST)) {
|
||||
arg = arg.substring(NetworkOptionKeys.BAN_LIST.length() + 1);
|
||||
|
@ -127,9 +127,9 @@ public class DummySeedNode {
|
|||
"Wrong program argument " + e);
|
||||
BanList.add(new NodeAddress(e));
|
||||
});
|
||||
log.info("From processArgs: ignoreList=" + list);
|
||||
log.debug("From processArgs: ignoreList=" + list);
|
||||
} else if (arg.startsWith(HELP)) {
|
||||
log.info(USAGE);
|
||||
log.debug(USAGE);
|
||||
} else {
|
||||
log.error("Invalid argument. " + arg + "\n" + USAGE);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public class DummySeedNode {
|
|||
|
||||
String logPath = Paths.get(appPath.toString(), "logs").toString();
|
||||
Log.setup(logPath);
|
||||
log.info("Log files under: " + logPath);
|
||||
log.debug("Log files under: " + logPath);
|
||||
Version.printVersion();
|
||||
Utilities.printSysInfo();
|
||||
Log.setLevel(logLevel);
|
||||
|
@ -179,11 +179,11 @@ public class DummySeedNode {
|
|||
|
||||
File storageDir = Paths.get(appPath.toString(), "db").toFile();
|
||||
if (storageDir.mkdirs())
|
||||
log.info("Created storageDir at " + storageDir.getAbsolutePath());
|
||||
log.debug("Created storageDir at " + storageDir.getAbsolutePath());
|
||||
|
||||
File torDir = Paths.get(appPath.toString(), "tor").toFile();
|
||||
if (torDir.mkdirs())
|
||||
log.info("Created torDir at " + torDir.getAbsolutePath());
|
||||
log.debug("Created torDir at " + torDir.getAbsolutePath());
|
||||
|
||||
seedNodesRepository.setNodeAddressToExclude(mySeedNodeAddress);
|
||||
seedNodeP2PService = new P2PService(seedNodesRepository, mySeedNodeAddress.port, maxConnections,
|
||||
|
|
|
@ -126,7 +126,7 @@ public class SeedNode {
|
|||
|
||||
public void shutDown() {
|
||||
gracefulShutDown(() -> {
|
||||
log.info("Shutdown complete");
|
||||
log.debug("Shutdown complete");
|
||||
System.exit(0);
|
||||
});
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public class SeedNode {
|
|||
injector.getInstance(P2PService.class).shutDown(() -> {
|
||||
injector.getInstance(WalletService.class).shutDownDone.addListener((ov, o, n) -> {
|
||||
seedNodeModule.close(injector);
|
||||
log.info("Graceful shutdown completed");
|
||||
log.debug("Graceful shutdown completed");
|
||||
resultHandler.handleResult();
|
||||
});
|
||||
injector.getInstance(WalletService.class).shutDown();
|
||||
|
@ -152,7 +152,7 @@ public class SeedNode {
|
|||
UserThread.runAfter(resultHandler::handleResult, 1);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
log.info("App shutdown failed with exception");
|
||||
log.debug("App shutdown failed with exception");
|
||||
t.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue