codemonkeyricky/piracast — pull request #3 by fazo96 (2014-02-23 18:13:59+00:00)
Title: Fixed bug with Nexus 4 not able to connect most of the time

**I had a bug** where every time I connect my Nexus 4, the peer_status changes from 2 to 22 for a few seconds then it goes back to 2 and connection fails. If I try let's say 20-50 times I can sometimes get it to connect because instead of status 22 it goes into status 8 (Discovery Request) and it works!

**My solution**: treat status 22 as if it's status 8 (Discovery Request) because it probably is anyway. It works very well and with this fix I can connect every single time I try without fail.

I'm sorry for the garbage diff, I only changed line *300-310*:
from ```if peer_status == 8:``` to ```if peer_status == 8 or peer_status == 22:```
And that's it.