OpenBazaar/OpenBazaar — pull request #781 by yagoulas (2014-10-12 10:48:05+00:00)
Title: Call search_for_my_node in a delayed callback in the ioloop

#### Bug
In order to get all the peers in our network we have to call `search_for_my_node`. The code for this was already in `join_network` however it was commented out because it didn't work. The reason for this is that `search_for_my_node` was called directly, before it was made sure that a handshake was completed with a seed.

#### Fix
To fix this issue I added a callback that runs when the `ioloop` starts and afterwards sets a timer for 5 seconds to give enough time for the handshake with the seeds to complete. The reason for calling add_callback as well is that tt is better to first wait for the `ioloop` to start processing events because `call_later` method registers the callback x seconds after the call to `call_later`. However if we spend a few seconds until the `ioloop` starts we may not give enough time for it to process all incoming messages needed for the handshake.