diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java index 308e95b19f..d5b9bcd7c6 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java @@ -32,6 +32,7 @@ import tech.pegasys.pantheon.metrics.MetricCategory; import tech.pegasys.pantheon.metrics.MetricsSystem; import tech.pegasys.pantheon.util.Subscribers; +import tech.pegasys.pantheon.util.bytes.BytesValues; import tech.pegasys.pantheon.util.uint.UInt256; import java.util.ArrayList; @@ -69,7 +70,9 @@ public DefaultMutableBlockchain( MetricCategory.BLOCKCHAIN, "difficulty_total", "Total difficulty of the chainhead", - () -> (double) this.getChainHead().getTotalDifficulty().toLong()); + () -> + BytesValues.asUnsignedBigInteger(this.getChainHead().getTotalDifficulty().getBytes()) + .doubleValue()); } @Override