diff --git a/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallenge.java b/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallenge.java index 759a3c4c20c..6e0928f4774 100644 --- a/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallenge.java +++ b/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallenge.java @@ -18,6 +18,7 @@ package co.rsk.net.discovery; +import org.apache.commons.lang3.builder.ToStringBuilder; import org.ethereum.net.rlpx.Node; /** @@ -45,4 +46,13 @@ public Node getChallenger() { public String getChallengeId() { return challengeId; } + + @Override + public String toString() { + return new ToStringBuilder(this) + .append("challengedNode", this.challengedNode) + .append("challenger", this.challenger) + .append("challengeId", this.challengeId) + .toString(); + } } diff --git a/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallengeManager.java b/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallengeManager.java index 324aaf8bc77..5a759f7c9ca 100644 --- a/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallengeManager.java +++ b/rskj-core/src/main/java/co/rsk/net/discovery/NodeChallengeManager.java @@ -49,7 +49,7 @@ public NodeChallenge startChallenge(Node challengedNode, Node challenger, PeerEx public NodeChallenge removeChallenge(String challengeId) { NodeChallenge removedChallenge = activeChallenges.remove(challengeId); - logger.debug("removeChallenge - Removed challenge for node: [{}]", removedChallenge.getChallengedNode().getHexId()); + logger.debug("removeChallenge - Removed challenge: [{}]", removedChallenge); return removedChallenge; }