From 5eed030a3f55f8700995a9a319a388945f6e30ba Mon Sep 17 00:00:00 2001 From: cherry1603 <565993183@qq.com> Date: Sun, 9 Apr 2023 19:34:39 +0800 Subject: [PATCH] fix miner address displayed in the RPC --- .../java/io/xdag/rpc/modules/web3/Web3XdagModuleImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/xdag/rpc/modules/web3/Web3XdagModuleImpl.java b/src/main/java/io/xdag/rpc/modules/web3/Web3XdagModuleImpl.java index a90aae3d..247817bc 100644 --- a/src/main/java/io/xdag/rpc/modules/web3/Web3XdagModuleImpl.java +++ b/src/main/java/io/xdag/rpc/modules/web3/Web3XdagModuleImpl.java @@ -63,6 +63,8 @@ import java.util.List; import java.util.Map; import java.util.Objects; + +import io.xdag.utils.PubkeyAddressUtils; import org.apache.commons.lang3.StringUtils; import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.bytes.MutableBytes32; @@ -285,7 +287,7 @@ public String xdag_getMaxXferBalance() throws Exception { } private PoolWorkerDTO getPoolWorkerDTO(PoolWorkerDTO.PoolWorkerDTOBuilder poolWorkerDTOBuilder,Miner miner){ - poolWorkerDTOBuilder.address(BasicUtils.hash2Address(miner.getAddressHash())) + poolWorkerDTOBuilder.address(PubkeyAddressUtils.toBase58(miner.getAddressHashByte())) .status(miner.getMinerStates().toString()) .unpaidShares(MinerCalculate.calculateUnpaidShares(miner)) .hashrate(BasicUtils.xdag_log_difficulty2hashrate(miner.getMeanLogDiff()))