From e232ac43f47116ef0c8b535f97dd0d01a05482ec Mon Sep 17 00:00:00 2001 From: Cedric Fung Date: Fri, 1 Mar 2019 22:58:05 +0800 Subject: [PATCH] fix the RPC getinfo consensus nodes --- rpc/info.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rpc/info.go b/rpc/info.go index 528b4b451..a0adb4431 100644 --- a/rpc/info.go +++ b/rpc/info.go @@ -39,8 +39,18 @@ func getInfo(store storage.Store, node *kernel.Node) (map[string]interface{}, er "hash": r.Hash.String(), } } + + nodes := make([]map[string]interface{}, 0) + for id, n := range node.ConsensusNodes { + nodes = append(nodes, map[string]interface{}{ + "node": id, + "signer": n.Signer.String(), + "payee": n.Payee.String(), + "state": n.State, + }) + } info["graph"] = map[string]interface{}{ - "consensus": node.ConsensusNodes, + "consensus": nodes, "cache": cacheGraph, "final": finalGraph, "topology": node.TopologicalOrder(),