Closed yarikk closed 2 years ago
See #33 (comment).
This one's not quite related to the topic of the marshaller change. This adds convenience methods for mutating the lists, making them suitable both for marshalling and for holding the data over many cycles and thus saving from extra alloc/copy overhead. We used to have (and use) the methods elsewhere; with this, they become a part of the API, covered with tests, and can be used in more applications if needed.
Add
NodeAddr.Equal()
andCompactIPv[46]NodeAddrs.Index()
methods.Lifted from the PEX code in anacrolix/torrent.
@anacrolix