Skip to content

Commit

Permalink
Write a DEBUG log entry to make it clear of a BFT node is a validator…
Browse files Browse the repository at this point in the history
… or not (hyperledger#6470)

Signed-off-by: Matthew Whitehead <[email protected]>
Co-authored-by: Sally MacFarlane <[email protected]>
  • Loading branch information
matthew1001 and macfarla authored Jan 29, 2024
1 parent e55569c commit 0f91a67
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
import java.time.Clock;
import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** This is the full data set, or context, required for many of the aspects of BFT workflows. */
public class BftFinalState {

private static final Logger LOG = LoggerFactory.getLogger(BftFinalState.class);

private final ValidatorProvider validatorProvider;
private final NodeKey nodeKey;
private final Address localAddress;
Expand Down Expand Up @@ -126,7 +132,9 @@ public boolean isLocalNodeProposerForRound(final ConsensusRoundIdentifier roundI
* @return the boolean
*/
public boolean isLocalNodeValidator() {
return getValidators().contains(localAddress);
final boolean isValidator = getValidators().contains(localAddress);
LOG.debug(isValidator ? "Local node is a validator" : "Local node is a non-validator");
return isValidator;
}

/**
Expand Down

0 comments on commit 0f91a67

Please sign in to comment.