GetPublicKey gets a PublicKey of given id Returns an error if the id was not found.
(id proto.NodeID)
| 178 | // GetPublicKey gets a PublicKey of given id |
| 179 | // Returns an error if the id was not found. |
| 180 | func GetPublicKey(id proto.NodeID) (publicKey *asymmetric.PublicKey, err error) { |
| 181 | node, err := GetNodeInfo(id) |
| 182 | if err == nil { |
| 183 | publicKey = node.PublicKey |
| 184 | } |
| 185 | return |
| 186 | } |
| 187 | |
| 188 | // GetNodeInfo gets node info of given id |
| 189 | // Returns an error if the id was not found. |