Peer returns the address of the peer with the given id.
(pid uint64)
| 221 | |
| 222 | // Peer returns the address of the peer with the given id. |
| 223 | func (n *Node) Peer(pid uint64) (string, bool) { |
| 224 | n.RLock() |
| 225 | defer n.RUnlock() |
| 226 | addr, ok := n.peers[pid] |
| 227 | return addr, ok |
| 228 | } |
| 229 | |
| 230 | // SetPeer sets the address of the peer with the given id. The address must not be empty. |
| 231 | func (n *Node) SetPeer(pid uint64, addr string) { |
no test coverage detected