The synchronizer's work is done from the network proxy's main loop.
A minor problem with the old synchronizer was that it considered itself
out of date if the network was out of date. This was too generic: the
network can have pending requests unrelated to the synchronizer. This
resulted in the synchronizer often unnecessarily flipping the wallet
between up-to-date and not-up-to-date, and causing unnecessary calls
to wallet.save_transactions(). This was observable when opening the
network dialog box: frequently just opening it would cause a wallet
status change and transaction flush, simply because the network dialog
sends a get_parameters() request. This rework of the synchronizer does
not have that issue.
This is working towards showing transactions before asking for passwords.
I think it also means the transaction dialog now interacts properly with
plugins, whereas it didn't before.
send_tx now takes a callback instead of a label, and does not decide
on whether to broadast itself; that is left to its caller.
broadcast_transaction() takes care of adding the description of the
successfully broadcast transaction to the wallet. Previously labels
could be added to the wallet even if the broadcast was cancelled by
the user or unsuccessful, which doesn't seem right.
Lengthen the dialog messages a little, as some window managers lose the
"Please Wait" title bar owing to window decorations if the message
is too short.
This is a layering violation - the SocketPipe doesn't own
the socket and provides no other way to close the socket, leading
to unnecessary complexity like that in interface.py.
I looked at deamon.py and NetworkProxy - the two other users,
and they don't close the sockets explicitly, just let them be
garbage collected.