Use a shared device manager across USB devices (not yet taken
advantage of by ledger). This reduces USB scans and abstracts
device management cleanly.
We no longer scan at regular intervals in a background thread.
Benefits of this rewrite include:
- support of disconnecting / reconnecting a device without having
to close the wallet, even in a different USB socket
- support of multiple keepkey / trezor devices, both during wallet
creation and general use
- wallet is watching-only dynamically according to whether the
associated device is currently plugged in or not
Break out the workflow logic of the install wizard
into a base class. This means reimplementing with
full support in a new GUI is now easy; you just provide
ways to request passwords, show messages etc. The API
is fully documented in the base class.
There are a couple of minor outstanding issues, including that
the old messages shown when recovering a wallet are missing.
I will come back to that. Ledger wallet might be broken.
Other improvements:
The install wizard code is now easy to follow and understand.
Hardware wallets can now be restored without any need for their
accompanying libraries.
Various bits of trustedcoin were broken and have been fixed.
Many plugin hooks can be removed. I have only started on this.
They have a different wallet type; they require no plugin nor
plugin libraries to use.
Remove pointless public key code that was implemented in the
base classes already.
Partial fix for #1592. Unfortunately the plugin and library
are still required to actually restore the wallet, but for
no reason that isn't fixable.
As per BIP44, 20 addresses are checked for transactions, not just the
first one.
Show the last account only if used or named.
If all accounts are used, prompt for password to create new one.
Fixes#1128
The --offline flag applies only to GUI.
Commands must use the daemon if a daemon is running, otherwise they are run offline.
Commands that only require the wallet do not have the require_network flag.
This should speed up synchronization / restoration of large wallets.
Wallets are written only when they switch to up_to_date state, or
when stop_threads() is called when closing the daemon, or when
a command line command finishes.
Change amounts could be negative after deducting the cost of the extra
change output; floor them at zero. Move the assertion to the main
code. Simplify rounding logic.