This is somewhat cleaner as the proxy's pipe and network setup
was awkwardly interleaved. It also means network's constructor
is free to use both; currently some code is working around the
fact that the response queue doesn't exist in the constructor.
Found these issues while trying to create, sign, and broadcast a raw transaction.
* createrawtransaction was using old signature for Transaction constructor
* Signwithwallet and decoderawtransaction need to call deserialize on tx before they can access inputs and outputs. (Maybe adding getInputs() and getOutputs() which deserializes if needed might be nicer)
A couple of changes
1) Old electrum wallets seemed to save labels in latin1, when you call json.dumps on line 83/84 it fails silently, which causes the label import to fail. Whenever electrum saves, it then overwrites your default wallet with no labels - essentially deleting all your labels. The solution to this is iterating over all the labels for old wallets decoding anything that fails to unicode() as latin1, and then unicoding it :)
2) Failing to import data and then deleting it is bad. So I'm raising an exception to avoid data being lost.
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.