Useful for ensuring that the test can still reproduce the issue with changes to encryption handling.
func (cl *Client) forSkeys(f func([]byte) bool) {
cl.lock()
defer cl.unlock()
+ if false { // Emulate the bug from #114
+ var firstIh InfoHash
+ for ih := range cl.torrents {
+ firstIh = ih
+ break
+ }
+ for range cl.torrents {
+ if !f(firstIh[:]) {
+ break
+ }
+ }
+ return
+ }
for ih := range cl.torrents {
if !f(ih[:]) {
break