diff --git a/src/main/java/org/bdware/sc/ContractManager.java b/src/main/java/org/bdware/sc/ContractManager.java index 4ba4203..532b345 100644 --- a/src/main/java/org/bdware/sc/ContractManager.java +++ b/src/main/java/org/bdware/sc/ContractManager.java @@ -1524,12 +1524,13 @@ public class ContractManager { // LOGGER.info("查看合约 " + cr.getContractID() + " 的master为 " + pubKey); - if (!masterStub.hasAgentConnection(pubKey)) { - pubKey = nodeCenterConn.reRouteContract(cr.getContractID()); - LOGGER.info("查看合约 " + cr.getContractID() + " 的master为 " + pubKey); - } + if (null != pubKey) { + if (!masterStub.hasAgentConnection(pubKey)) { + pubKey = nodeCenterConn.reRouteContract(cr.getContractID()); + LOGGER.info("查看合约 " + cr.getContractID() + " 的master为 " + pubKey); + } masterStub.executeByOtherNodeAsync(pubKey, cr, rcb); return; // result = masterStub.executeByOtherNode(pubKey, cr); diff --git a/src/main/java/org/bdware/sc/handler/ManagerHandler.java b/src/main/java/org/bdware/sc/handler/ManagerHandler.java index 35309dd..95f1f0a 100644 --- a/src/main/java/org/bdware/sc/handler/ManagerHandler.java +++ b/src/main/java/org/bdware/sc/handler/ManagerHandler.java @@ -87,7 +87,7 @@ public class ManagerHandler extends MsgHandler { @Description("add distributed execution member, sample: {contractID:id/name, arg:ipAndPort}") public void addDEMember(GetMessage msg, ResultCallback cb) { ContractRequest cr = JsonUtil.fromJson(msg.arg, ContractRequest.class); - cb.onResult(cm.addDEMember(cr.getContractID(), cr.getArg())); + cb.onResult(cm.addDEMember(cr.getContractID(), cr.getArg().getAsString())); } /**