Write a DEBUG log entry to make it clear of a BFT node is a validator or not (#6470)

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6490/head
Matt Whitehead 10 months ago committed by GitHub
parent e55569cb90
commit 0f91a674ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/statemachine/BftFinalState.java

@ -28,8 +28,14 @@ import org.hyperledger.besu.datatypes.Address;
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;
@ -126,7 +132,9 @@ public class BftFinalState {
* @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;
}
/**

Loading…
Cancel
Save