Skip to content

Commit

Permalink
Add toString to NodeChallenge
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Oct 31, 2023
1 parent 3661511 commit 8d6270a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions rskj-core/src/main/java/co/rsk/net/discovery/NodeChallenge.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package co.rsk.net.discovery;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.ethereum.net.rlpx.Node;

/**
Expand Down Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.

return removedChallenge;
}
Expand Down

0 comments on commit 8d6270a

Please sign in to comment.