diff --git a/src/main/java/com/webank/webase/node/mgr/contract/ContractService.java b/src/main/java/com/webank/webase/node/mgr/contract/ContractService.java index 410e15f71..8610acbb3 100644 --- a/src/main/java/com/webank/webase/node/mgr/contract/ContractService.java +++ b/src/main/java/com/webank/webase/node/mgr/contract/ContractService.java @@ -792,7 +792,18 @@ public List getContractManager(int groupId, String contractAddress) { List resultUserList = new ArrayList<>(); // get deployAddress from external service TbExternalContract extContract = extContractService.getByAddress(groupId, contractAddress); - String deployAddress = extContract.getDeployAddress(); + String deployAddress; + if (extContract != null) { + deployAddress = extContract.getDeployAddress(); + } else { + TbContract contract = this.queryContractByGroupIdAndAddress(groupId, contractAddress); + if (contract != null) { + deployAddress = contract.getDeployAddress(); + } else { + log.warn("getContractManager get contract's deploy user address fail"); + return resultUserList; + } + } // check if address has private key TbUser deployUser = userService.checkUserHasPk(groupId, deployAddress); if (deployUser != null) { @@ -824,4 +835,15 @@ public List getContractManager(int groupId, String contractAddress) { } return resultUserList; } + + public TbContract queryContractByGroupIdAndAddress(int groupId, String contractAddress) { + log.debug("start queryContractByGroupIdAndAddress groupId:{},contractAddress:{}", groupId, contractAddress); + ContractParam param = new ContractParam(); + param.setGroupId(groupId); + param.setContractAddress(contractAddress); + TbContract contract = this.queryContract(param); + log.debug("end queryContractByGroupIdAndAddress contract:{}", contract); + return contract; + + } }