* Handle Torrent being dropped before GotInfo.
* Track connection chunk contributions to successful and failed piece hashes. Only drop the worst performer on a bad hash. Maybe block its IP.
* Remove assumptions that the first piece requested will be the first that peers will send.
+ * Clean-up DHT transaction code, it's just nasty.
return
}
select {
- case r := <-t.response:
+ case r, ok := <-t.response:
+ if !ok {
+ // TODO: I think some assumption is broken. This isn't supposed to
+ // happen.
+ break
+ }
t.userOnResponse(r)
// Shouldn't be called more than once.
t.userOnResponse = nil