Resolve implements the node ID resolver using the BP network with mux-RPC protocol.
(id *proto.RawNodeID)
| 60 | |
| 61 | // Resolve implements the node ID resolver using the BP network with mux-RPC protocol. |
| 62 | func (r *Resolver) Resolve(id *proto.RawNodeID) (string, error) { |
| 63 | if r.direct { |
| 64 | node, err := GetNodeInfo(id) |
| 65 | if err != nil { |
| 66 | return "", err |
| 67 | } |
| 68 | if node.Role == proto.Miner { |
| 69 | return node.DirectAddr, nil |
| 70 | } |
| 71 | return node.Addr, nil |
| 72 | } |
| 73 | return GetNodeAddr(id) |
| 74 | } |
| 75 | |
| 76 | // ResolveEx implements the node ID resolver extended method using the BP network |
| 77 | // with mux-RPC protocol. |
nothing calls this directly
no test coverage detected