Commit Graph

2114 Commits

Author SHA1 Message Date
ThomasV ee5f499fc1 use contacts in command line 2015-05-31 14:10:52 +02:00
ThomasV 5cd3bfedb6 always pass coins to wallet.make_unsigned_transactions. fix \! shortcut in commands 2015-05-31 11:31:41 +02:00
ThomasV 0531f00c80 support for \! shortcut in command line 2015-05-31 10:40:12 +02:00
ThomasV 0caa29784c separate param_descriptions and improve help messages 2015-05-31 10:03:53 +02:00
ThomasV cc610d352f merge signtxwithwallet and signtxwithkey 2015-05-31 09:28:47 +02:00
ThomasV 1d5f04c588 fix function name 2015-05-31 08:49:47 +02:00
ThomasV 53a3f00389 add --deserialize option to gettransaction 2015-05-31 08:20:09 +02:00
ThomasV 9acc0e4ed0 minor formatting 2015-05-31 08:06:20 +02:00
ThomasV 2167b9e93d Merge pull request #1264 from kyuupichan/unify_interfaces
Remove pending_servers, self.interfaces is now the complete set of
2015-05-31 08:02:47 +02:00
ThomasV bd6bfcea0e Merge pull request #1267 from kyuupichan/spendable_coins
get_spendable_coins and frozen addrs
2015-05-31 07:53:43 +02:00
Neil Booth 320f9a3790 get_spendable_coins and frozen addrs
Two callers of get_spendable_coins were removing frozen addrs
before calling.  Put that functionality in the function.
We shouldn't be able to send_from a frozen address.  This was
possible in the current release because logic assumed a two-element
tuple was returned when it is now three-element.  Fix that too.

Command line options listunspent and createrawtransaction currently
ignore frozen addresses.  I'm not sure that's right but I've preserved
that behaviour.

With this patch only the wallet class refers to self.frozen_addresses;
other clients use is_frozen() now.
2015-05-31 14:07:50 +09:00
ThomasV 00ded10810 fix: freeze does not need password 2015-05-31 06:45:51 +02:00
Neil Booth 0f29984f07 Speed up freezing and unfreezing of many addresses
Speedup mainly from writing to storage only once.
Make frozen_addresses a set in memory, as sets give cleaner
code and are more efficient.

Minor change in behaviour: command line freezing used to return
False if the address isn't in the wallet OR the address was already
frozen.  Now it returns more like a success code: it returns False
only if the address isn't in the wallet regardless of frozen state.
Similarly for unfreezing.
2015-05-31 11:54:21 +09:00
ThomasV d6f4b57d64 help function for python console 2015-05-30 19:13:28 +02:00
ThomasV 92a158b910 proper handling of arg_types. add more options for listaddresses 2015-05-30 18:49:58 +02:00
ThomasV 2ab9272f52 fix positional arguments 2015-05-30 16:14:56 +02:00
ThomasV 966bb3c15f separate help and description for commands 2015-05-30 14:07:48 +02:00
ThomasV 0ad73b0899 better help 2015-05-30 13:38:05 +02:00
ThomasV d2f3e3f349 fix cmdline listcontacts 2015-05-30 12:35:58 +02:00
Neil Booth 2b66f0d459 Remove pending_servers, self.interfaces is now the complete set of
interfaces we have created.

Existing code has the concept of pending servers, where a connection
thread is started but has not sent a connection notification, and
and interfaces which have received the notification.

This separation caused a couple of minor bugs, and given the cleaner
semantics of unifying the two I don't think the separation is beneficial.
The bugs:

1) When stopping the network, we only stopped the connected interface
threads, not the pending ones.  This would leave Python hanging
on exit if we don't make them daemon threads.

2) start_interface() did not check pending servers before starting
a new thread.  Some of its callers did, but not all, so it was
possible to initiate two threads to one server and "lose" one thread.

Apart form fixing the above two issues, unification causes one more
change in semantics: we are now willing to switch to a connection
that is pending (we don't switch to failed interfaces). I don't
think that is a problem: if it times out we'll just switch
again when we receive the disconnect notification, and previously the
fact that an interface was in the interaces dictionary wasn't a
guarantee the connection was good anyway: we might not have processed
a pending disconnection notification.
2015-05-30 17:42:11 +09:00
Neil Booth 4eaff5678d Avoid change address reuse if possible
As discussed on #electrum yesterday.
Increase change gap limit to 6.
Choose the next unused change address, if any, otherwise pick
one at random from the gap limit.
2015-05-30 17:07:29 +09:00
ThomasV 48f98f75db improve help messages 2015-05-30 09:43:42 +02:00
ThomasV bf1aa6263c add description to command parameters 2015-05-30 09:36:54 +02:00
ThomasV 5dd535f915 move global options to parent, to avoid order-sensitive parsing 2015-05-30 07:58:47 +02:00
ThomasV 701527df20 fix -P option 2015-05-30 06:56:45 +02:00
ThomasV 6201133c48 fix #1263 2015-05-30 06:38:46 +02:00
ThomasV a0c7219db0 rm debugging print 2015-05-29 19:30:00 +02:00
ThomasV 2e67ca43e8 use csv instead of mkmanytx 2015-05-29 19:26:06 +02:00
ThomasV 3ddbbc1008 Parse arguments with argparse.
Move parser to commands.py
2015-05-29 19:24:50 +02:00
ThomasV 3195b94f28 Merge pull request #1257 from kyuupichan/update_fee
Fix calls to update_fee
2015-05-28 19:34:04 +02:00
ThomasV a3dd51f476 rm failing test 2015-05-28 15:43:50 +02:00
ThomasV 9dc8393cf6 move import test to wallet.py 2015-05-28 15:39:26 +02:00
ThomasV 3fdfd23ca9 add check in importprivkey 2015-05-28 15:27:22 +02:00
Neil Booth 05cb9975cb Fix calls to update_fee
Fees should be recalculated when send_from changes.
Fees should be recalculated when editing fee preference, but
only save to storage when leaving the fee per kb widget.
No need to emit a textEdited signal; the widget does that already
(with the effect that we used to call update_fee() twice).
2015-05-28 15:52:31 +09:00
ThomasV dd8493f97e make coin selection a bit faster 2015-05-27 11:07:57 +02:00
ThomasV 65e7dca3de Merge pull request #1249 from kyuupichan/stale_interfaces2
Common stale interface testing and switching
2015-05-27 10:42:59 +02:00
ThomasV 8e6e4f1b92 Merge pull request #1255 from kyuupichan/amountedit2
Fix nasty bug in amount editors
2015-05-27 10:19:07 +02:00
Neil Booth e5d243e08c Fix nasty bug in amount editors
str() can convert amounts to scientific notation
2015-05-27 17:14:40 +09:00
Neil Booth 45a8740755 Common stale interface testing and switching
Three places used to test for lagging and switch.  Commonize the
code.  We test for lagging before autoconnect so lagging
diagnostics are output if not auto-connect.

Lagging diagnotics moved to server_is_lagging().
2015-05-27 00:42:43 +09:00
ThomasV ae957f3736 make_transaction: remove unneeded inputs 2015-05-26 09:09:07 +02:00
ThomasV 7becb28ec8 Merge pull request #1246 from kyuupichan/bug_fix
e20dfc unintentionally inverted portable condition
2015-05-25 13:28:42 +02:00
Neil Booth e63ac88c77 e20dfc unintentionally inverted portable condition
This wasn't noticed because the test was also broken.
2015-05-25 16:59:16 +09:00
Neil Booth 39fe24b4d3 Rename auto_cycle to auto_connect in config
User config is updated if appropriate.
Add tests behaviour is as expected.
Just the one rename-it reference to auto_cycle remains.
2015-05-25 16:18:52 +09:00
ThomasV d5f6651237 follow up e20dfcd3eb 2015-05-25 08:47:25 +02:00
Neil Booth e20dfcd3eb Fix SimpleConfig
SimpleConfig claims to handle configuration options in priority
command line, user config, system config, which makes sense.
In fact it appears it used priority command line, system config,
user config.
Also, from the priority ordering, it would seem correct that a
value should be unmodifiable if and only if it's set on the command
line.  Previously anything in the system config would be unmodifiable.

This patch fixes these and cleans the code up a bit.  I noticed this
whilst attempting to unify the 'auto_cycle' setting.

Fixup tests accordingly.
2015-05-25 15:16:19 +09:00
Neil Booth 4f6d2f3d32 Put getting of auto_cycle into one place.
Default to False consistently; this may change the behaviour of
network.py's get_parameters().
2015-05-25 14:09:43 +09:00
ThomasV 778297697a lazy plugin constructor 2015-05-24 20:37:05 +02:00
ThomasV 71046371ec Merge pull request #1242 from kyuupichan/pick_random_server
Clean up pick_random_server() and filter_protocol() and their
2015-05-24 16:43:17 +02:00
ThomasV 117b809bab fix issue #1238 2015-05-24 16:14:56 +02:00
Neil Booth 01d8f79a75 Clean up pick_random_server() and filter_protocol() and their
call sites.

Remove unused imports and redundant random pick of server
2015-05-24 21:07:35 +09:00