First, close the socket from the thread itself rather than from
the stop() function. This prevents another thread closing the
socket that the interface thread is simultaneously using.
Second, it occasionally would happen that the parent thread such as
network.py start() an interface, do a send_request() and timeout
waiting for a response (timeouts are 0.1s). It would check
is_connected(), get False, and assume the connection has failed.
In fact the thread hadn't even been scheduled or gotten around to
completing the socket connection. Fix by having self.connected
start out True. If the connection fails or times out, we set
connected to False soon enough.
Finally for correctness we need to deepcopy a send_request() rather
than take a reference to it.
The verifier will retain responsibility for verification, but will no longer
hold the transaction sets itself.
Change requires_fee to take a wallet.
Add new function add_unverified_tx()
Move get_confirmations() to the wallet from the verifier.
Currently requests are sent from the requestor's thread. The lock is
not properly held where necessary so this is not thread-safe. For example
it can race with the thread stopping and closing the socket the
requestor is trying to use to send with.
Resolve such races by having send_request() simply queue the requests,
which are asynchronously sent from the interface thread itself.
First step in cleaning up the run() function.
Calls stop() rather than setting is_connected to False on
case of timeout, which cleanly closes the socket.
We store it in the config object instead of in the blockchain object.
The blockchain object now refers to its config, and calls refresh_height() to update it.
The network objects also refer to the config rather than the blockchain.
This is the first of many small steps to untangle the verifier from stored state and so
permit the history tab to work in offline mode. The refactoring will simultaneously clean
up a lot of accumulated cruft.
Block explorer code is data-driven now.
Put block explorer defaulting in one place.
Fix URLs for insight.is and blockr.io.
Add tradeblock.com explorer.
Add menu item to view address on block explorer provided only one is selected.