From b3e092a5e8b60289567b7521e95c4a9d5fdeea89 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 6 Apr 2012 14:36:54 +0200 Subject: [PATCH] More logging in Peer/PeerGroup --- core/src/main/java/com/google/bitcoin/core/Peer.java | 2 +- core/src/main/java/com/google/bitcoin/core/PeerGroup.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index 75500afe..146c0d8a 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -212,7 +212,7 @@ public class Peer { } catch (IOException e) { if (!running) { // This exception was expected because we are tearing down the socket as part of quitting. - log.info("Shutting down peer loop"); + log.info("{}: Shutting down peer loop", address); } else { disconnect(); throw new PeerException(e); diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java index 581b62b6..11ec0e81 100644 --- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java +++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java @@ -325,6 +325,7 @@ public class PeerGroup { // This is run with the peer group already locked. for (Peer peer : peers) { try { + log.info("{}: Sending transaction {}", peer.getAddress(), tx.getHashAsString()); peer.sendMessage(tx); } catch (IOException e) { log.warn("Caught IOException whilst sending transaction: {}", e.getMessage()); @@ -685,6 +686,7 @@ public class PeerGroup { boolean success = false; for (Peer p : announceToPeers) { try { + log.info("{}: Announcing {} pending wallet transactions", p.getAddress(), inv.getItems().size()); p.sendMessage(inv); success = true; } catch (IOException e) {