Commit Graph

779 Commits

Author SHA1 Message Date
ThomasV 90a2fc1379 Revert "Fix MultiSig wallet creation."
This reverts commit 21038843ea.
2016-01-07 00:46:34 +01:00
ThomasV bdb4782b36 Revert "Install wizard multisig improvement"
This reverts commit 4e7c6e5d16.
That commit breaks the separation between make_seed and add_cosigners
2016-01-06 12:01:25 +01:00
Neil Booth 4e7c6e5d16 Install wizard multisig improvement
Preserves independence of wizard.py from wallet type;
the dependence is expressed entirely through actions

Fixes #1611
2016-01-06 19:31:12 +09:00
Neil Booth 21038843ea Fix MultiSig wallet creation.
Fixes #1603
2016-01-05 21:22:43 +09:00
ThomasV bd309cff49 restore default labels 2016-01-04 15:40:57 +01:00
Neil Booth f3e6bf0280 Passphrase-related fixes
Move normalize code to one place on the wallet
Passphrases don't have password strength meter
2016-01-03 09:03:07 +09:00
Neil Booth 21bf5a8a84 Better support for USB devices
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
2016-01-02 20:39:29 +09:00
Neil Booth dbf154d5f2 Finish moving the multisig regex to one place 2016-01-02 00:39:44 +09:00
Neil Booth 1d07960290 Remove constructor method of plugins
Clean up wallet class loading.
2016-01-02 00:16:15 +09:00
Neil Booth 11d135b32d Better install wizard
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.
2016-01-01 16:48:18 +09:00
Neil Booth e6dbe621c6 Make class methods static on Wallet 2015-12-31 16:05:05 +09:00
Neil Booth f263f8b0fd Convert legacy restored hardware wallets
Hardware wallets do not have a seed and hardware wallet
code should not have to worry about that case.
2015-12-31 09:51:27 +09:00
Neil Booth 84450b9189 Revert mistaken commit 2015-12-29 23:16:53 +09:00
Neil Booth 0f70d0b8a5 The constructor() concept doesn't exist
Did it ever?
2015-12-29 22:59:25 +09:00
Neil Booth 9d9fcbde64 Proper treatment of restored hardware wallets
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.
2015-12-28 20:24:15 +09:00
Neil Booth 11e1c62f28 Move hardware wallet to trezor/
On second thoughts it does go better there.
2015-12-27 18:23:46 +09:00
Neil Booth 669cf74789 Fix trezor restore
Broken by my recent changes
2015-12-27 15:38:52 +09:00
Neil Booth 3a1bb5b61a Combine keepkey and trezor wallet code
Essentially identical so silly to have two copies.
Also fix a double-dialog during sign bug that caused one to not
disappear (on MacOSX at least).
2015-12-26 16:25:10 +09:00
Neil Booth c298860e11 A fix and cleanups for hardware wallets 2015-12-26 12:02:19 +09:00
Neil Booth a58c19d7c0 Clean up and fix account adding
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
2015-12-25 23:34:04 +09:00
Neil Booth 72fdf0cd21 Better error when opening a non-wallet file
Also window modality fixes for __init__.py
2015-12-23 13:54:43 +09:00
Neil Booth e1c0298fc2 Write the wallet less often
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.
2015-12-20 15:47:46 +09:00
Neil Booth 0a3d74de8f Avoid index-out-of-range
Also add sanity assertion
2015-12-20 12:19:44 +09:00
ThomasV 9d3162b1a1 simplify get_label 2015-12-15 12:52:30 +01:00
Neil Booth 06eb3142c4 Oldest First 2015-12-12 19:01:14 +09:00
Neil Booth 52fc739052 Update default chooser name too. 2015-12-12 18:39:03 +09:00
Neil Booth 75b3ecee49 Add coin chooser to try and minimize loss of privacy. 2015-12-09 22:20:23 +09:00
ThomasV 4682d95a76 merge jsonrpc gui and daemon 2015-11-30 10:09:54 +01:00
Neil Booth 9a6dcf7b1e Use bucketing to choose coins
Bucketing is generalization of coin chooser logic that makes it easy
to implement other algorithms.

- Put core coin chooser functionality in base class.
- Specialize derived class to implement classic electrum algorithm of
  oldest coins first.  One bucket per output.

No intended change in behaviour.
Coin chooser now sorts the coins as it wants; remove redundant sorting
from get_spendable_coins().
2015-11-29 17:59:36 +09:00
Neil Booth 93bb09230c Track tx size directly; calculate fees from that
This has several advantages.  Fee calculation is now very fast,
as we don't need to keep reserializing the tx.  Another is that
we can reason about the fees after adding a change output without
having to add it, recalculate the tx fee, and remove it again.
2015-11-29 15:40:11 +09:00
Neil Booth a4dd5acc48 Prepare to calculate tx fee given a tx size 2015-11-29 12:41:54 +09:00
Neil Booth d97106f17d Don't keep dust change in any case 2015-11-28 22:27:01 +09:00
Neil Booth 8785b65a1f Remove need for coin chooser to take a wallet 2015-11-28 22:12:20 +09:00
Neil Booth a6ea9a0c71 Simplify interface to make_tx in coin chooser
Makes the coin chooser code simpler and easier to understand.
2015-11-28 22:08:00 +09:00
Neil Booth 90dee43998 Move estimated_fee to Transaction class
It's not a function of the wallet but of the transaction
so it more naturally belongs there.
2015-11-28 21:28:54 +09:00
Neil Booth e9061ea371 Move coin choosing logic to own class
This contains no change in logic, but is preparation for cleanup
and possible alternative strategies.
2015-11-28 14:49:10 +09:00
ThomasV 175fdbcac6 Disentangle plugins and window management; use Qt signals 2015-11-23 09:05:34 +01:00
Neil Booth 0dcaa13d31 Show the wallet path in -v output 2015-11-14 16:14:00 +09:00
ThomasV ae42576423 Merge branch 'master' of git://github.com/spesmilo/electrum 2015-11-12 14:32:19 +01:00
ThomasV 86a0103a7f increase min_relay_tx_fee, and make dust_threshold a function 2015-11-12 14:31:17 +01:00
Neil Booth 206e38fb7c Make use of trigger_callback easier to understand 2015-11-12 16:08:37 +09:00
Neil Booth 8cc3b58364 Allow syncronizer to be GC-ed
Proper fix for #1525.
Using python's GC module, I've verified that the daemon, when running,
now releases all verifiers, synchronizers and wallets - all the resources
we care about releasing.
2015-11-12 08:40:58 +09:00
Neil Booth d612684196 Attempt at fixing issue 1525
The main problem is, I think, that the synchronizer and wallet
still exist in the daemon process, and updates to things like
TXI and TXO are made but never saved (as client exit is what
saves the wallet).

I suspect fixing the lingering objects is hard; this is a short
term fix to ensure that when internal wallet state is updated,
the wallet is written to disk, so later daemon clients pick up
the correct state.
2015-11-11 16:38:28 +09:00
ThomasV 2a3c97813d wallet.get_max_amount method, used by qt and kivy 2015-10-30 14:10:41 +01:00
ThomasV 079cb311ec call wallet.wait_until_synchronized before commands 2015-10-29 05:01:06 +01:00
ThomasV 052d8b236e fix #1494 2015-10-28 10:36:44 +01:00
ThomasV 2a23aab24b workaround #1513 2015-10-28 07:32:29 +01:00
ThomasV 26682491b2 generic restore from command line 2015-10-27 14:33:41 +01:00
Neil Booth 97568bedf5 Default to unused address for privkey sweeps
Fixes #1506

- New function wallet.get_unused_addresses
- Have wallet.get_unused_address use it
- Use it for the sweep key dialog
2015-10-26 20:33:35 +09:00
ThomasV 171363aa86 minor fix (import stat) 2015-10-20 13:57:43 +02:00