(addr []byte)
| 58 | } |
| 59 | |
| 60 | func (r SlowRouter) Lookup(addr []byte) *Peer { |
| 61 | for _, t := range r { |
| 62 | common := commonBits(t.bits, addr) |
| 63 | if common >= t.cidr { |
| 64 | return t.peer |
| 65 | } |
| 66 | } |
| 67 | return nil |
| 68 | } |
| 69 | |
| 70 | func (r SlowRouter) RemoveByPeer(peer *Peer) SlowRouter { |
| 71 | n := 0 |
no test coverage detected