Skip to content

Commit 04eca9f

Browse files
committed
fix(metric): process the null witness address
1 parent 1a285fd commit 04eca9f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

framework/src/main/java/org/tron/core/metrics/node/NodeMetricManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ private void setNodeInfo(NodeInfo nodeInfo) {
3636

3737
nodeInfo.setIp(Args.getInstance().getNodeExternalIp());
3838

39-
ByteString witnessAddress = ByteString.copyFrom(Args.getLocalWitnesses()
40-
.getWitnessAccountAddress(CommonParameter.getInstance().isECKeyCryptoEngine()));
39+
byte[] witnessAccountAddress = Args.getLocalWitnesses()
40+
.getWitnessAccountAddress(CommonParameter.getInstance().isECKeyCryptoEngine());
41+
ByteString witnessAddress =
42+
witnessAccountAddress != null ? ByteString.copyFrom(witnessAccountAddress) : null;
4143
if (chainBaseManager.getWitnessScheduleStore().getActiveWitnesses().contains(witnessAddress)) {
4244
nodeInfo.setNodeType(1);
4345
} else {

framework/src/test/java/org/tron/core/zksnark/ShieldedReceiveTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ public void testBroadcastBeforeAllowZksnark()
320320
}
321321

322322
/*
323-
* generate spendproof, dataToBeSigned, outputproof example dynamically according to the params file
323+
* generate spendproof, dataToBeSigned, outputproof example dynamically according to the params
324+
* file
324325
*/
325326
public String[] generateSpendAndOutputParams() throws ZksnarkException, BadItemException {
326327
librustzcashInitZksnarkParams();

0 commit comments

Comments
 (0)