diff --git a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java index 67af913..61b7a3a 100644 --- a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java +++ b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java @@ -1464,6 +1464,22 @@ public class NodeCenterActions { return info; } + @Action(async = true) + public void queryNodeAddress(JsonObject args, final ResultCallback rc) { + args.addProperty("action", "onQueryNodeAddress"); + args.add("responseID", args.get("requestID")); + args.add("result", JsonNull.INSTANCE); + String nodePubkey = args.get("pubKey").getAsString(); + CMNode nodeInfo = nodeInfos.get(nodePubkey); + if (nodeInfo != null) { + JsonObject jo = new JsonObject(); + jo.addProperty("pubKey", nodePubkey); + jo.addProperty("masterAddress", nodeInfo.masterAddress); + args.add("result", jo); + } + rc.onResult(args); + } + @Action(async = true) public void queryRouteInfo(JsonObject args, final ResultCallback rc) { String contractID = args.get("contractID").getAsString(); @@ -1685,6 +1701,7 @@ public class NodeCenterActions { controller.sendMsg(JsonUtil.toJson(to)); } + @Action(async = true) public void askElectMasterTimeRecorder(JsonObject args, ResultCallback resultCallback) { String data = "null";