1/n Added peer store

This commit is contained in:
Igor Katson 2023-11-30 19:33:02 +00:00
parent 80b153dbca
commit 261ad3cc7c
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
5 changed files with 213 additions and 5 deletions

11
TODO.md
View file

@ -18,13 +18,18 @@
- [x] many nodes in "Unknown" status, do smth about it
- [x] for torrents with a few seeds might be cool to re-query DHT once in a while.
- [x] don't leak memory when deleting torrents (i.e. remove torrent information (seen peers etc) once the torrent is deleted)
- [ ] Routing table - is it balanced properly?
- [ ] Don't query Bad nodes
- [x] Routing table - is it balanced properly?
- [ ]
- [x] Don't query Bad nodes
- [-] Buckets that have not been changed in 15 minutes should be "refreshed." (per RFC)
- [ ] Did it, but it's flawed: starts repeating the same queries again as neighboring refreshes
- [x] Did it, but it's flawed: starts repeating the same queries again as neighboring refreshes
don't know about the other ones, and DHT returns the same nodes again and again.
- [x] it's sending many requests now way too fast, locks up Mac OS UI annoyingly
- [x] store peers sent to us with "announce_peer"
- [ ] announced peers should be persisted
- [ ] After the search is exhausted, the client then inserts the peer contact information for itself onto the responding nodes with IDs closest to the infohash of the torrent.
To do this, a
- [x] Ensure that if we query the "returned" nodes, they are even closer to our request than the responding node id was.
someday: