Commit Graph

4768 Commits

Author SHA1 Message Date
ThomasV 2f7503c635 Merge pull request #1253 from kyuupichan/fast_qr_draw
Speed up painting of qr codes.
2015-05-27 10:27:28 +02:00
ThomasV d0d1b41d63 fix #1251 2015-05-27 10:25:17 +02:00
ThomasV 3fc96b547f Merge branch 'master' of git://github.com/spesmilo/electrum 2015-05-27 10:19:21 +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
ThomasV d196c9d0a1 catch exceptions raised by validate 2015-05-27 09:23:11 +02:00
Neil Booth 85952a2dea Speed up painting of qr codes.
Probably speeds it up by about a factor of two.
Unfortunately it needs to be another 5x faster
for sluggishness to disappear in the GUI when
typing a description in the receive tab.

Note the old code was off-by-one.
2015-05-27 11:44:28 +09:00
ThomasV 5ba9303291 trezor handler for cmd line 2015-05-26 09:09:21 +02: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
ThomasV 2b50e4064c Merge pull request #1245 from kyuupichan/auto_connect
Rename auto_cycle to auto_connect in config
2015-05-25 13:28:00 +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
ThomasV d287152942 Merge pull request #1244 from kyuupichan/simple_config
Fix SimpleConfig
2015-05-25 08:36:46 +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
ThomasV 2928dfeb34 Merge pull request #1243 from kyuupichan/auto_cycle
Put getting of auto_cycle into one place.
2015-05-25 07:47:25 +02: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
ThomasV 48ad7c36a8 show plugin dependencies 2015-05-24 10:06:53 +02:00
ThomasV d40c12c949 check gui when loading plugins 2015-05-24 09:26:28 +02:00
ThomasV a48a7951a7 Merge pull request #1239 from kyuupichan/set_parameters
Improve logic in network.py's set_parameters()
2015-05-23 16:41:06 +02:00
Neil Booth 89c1a1a0ab Improve logic in network.py's set_parameters()
1) For new proxy or protocol, restart the network and default to
   the requested server.
2) Otherwise if we aren't using the requested server, switch to it
3) Otherwise choose a random server if the requested server is
   stale and auto_connect is True

As switch_to_interface() now has another user, move the logic
there whereby we close the old interface in order to terminate
subscriptions, in order to have it in one place.
2015-05-23 23:33:17 +09:00
ThomasV 8f98ea4aca make plugins available without the GUI 2015-05-23 10:38:19 +02:00
ThomasV 89c277de9d fix pruning error in #1223 2015-05-23 08:45:27 +02:00
ThomasV 0fbbeb16be Merge pull request #1232 from kyuupichan/switch-or-start
switch_to_interface() to start interface if not connected
2015-05-23 07:30:00 +02:00
ThomasV 4aaa9e24f2 Merge pull request #1234 from kyuupichan/storage-tmpfile
Prevent race with two electrum instances on same wallet.
2015-05-23 07:22:12 +02:00
ThomasV 91a7a06b38 Merge pull request #1236 from kyuupichan/rel-notes-2.2
Tweak RELEASE-NOTES
2015-05-23 07:20:44 +02:00
ThomasV 57c8577d66 Merge pull request #1235 from kyuupichan/storage-write-once
Flush wallet storage once for a sequence of puts.
2015-05-23 07:20:22 +02:00
Neil Booth 22d180f8fe Tweak RELEASE-NOTES
The claim to show thousands separators has already confused
some people who didn't see it.
2015-05-23 10:57:30 +09:00
Neil Booth 77490e4764 Flush wallet storage once for a sequence of puts.
This speeds up save_transactions by 2 to 3 times for me.
2015-05-23 10:52:10 +09:00
Neil Booth 33a8348d48 Prevent race with two electrum instances on same wallet.
Whilst it's not a good idea to have two electrum instances
open on the same wallet, we should avoid throwing an
exception.  Also note how the old code's handling of the
exception (caused by both renaming the file almost at the
same time, rather than a non-POSIX system not supporting
the atomic rename) can lead to the wallet file being lost
enirely because os.remove(self.path) succeeds and the
rename of the temporary no-longer-existing file then fails.
2015-05-23 10:24:10 +09:00
ThomasV b029589fc1 fix issue #1233 2015-05-22 20:47:51 +02:00
Neil Booth 2f34f3db21 Only start if not already in pending_servers
This was only in one call site previously, not both.
2015-05-22 16:29:56 +09:00
Neil Booth 31ffd4b381 switch_to_interface() to start interface if not connected
Two places currently have switch-to-or-start-interface logic.
Put that common logic into switch_to_interface().
2015-05-22 16:24:58 +09:00
ThomasV 16b23a1832 Merge pull request #1231 from kyuupichan/if-add-remove
Absorb add_interface and remove_interface
2015-05-22 08:33:13 +02:00
Neil Booth 346e38674b Absorb add_interface and remove_interface
They are now only called from the same place; it's simpler
and clearer to put them inline.
2015-05-22 15:26:17 +09:00
ThomasV 0b201d98ab Merge pull request #1230 from kyuupichan/switch-random-if
Remove interfaces in one place only
2015-05-22 08:13:14 +02:00
ThomasV e13e42a00c Merge pull request #1229 from kyuupichan/uri-format
Plain number formatting for URIs.
2015-05-22 08:12:09 +02:00
Neil Booth 274965468e Remove interfaces in one place only
switch_to_random_interface used to do is_connected()
checks and remove interfaces when switching.  This
is redundant: interfaces are only added to self.interfaces
once in is_connected() state from process_if_notification().
When they are disconnected, a notification is also received
and process_if_notification() performs the removal.  Furthermore,
two other callers of switch_to_interface do not do explicit
is_connected() checks before calling it.
2015-05-22 15:01:11 +09:00
ThomasV c7b33a9e4a Merge pull request #1228 from kyuupichan/net-interfaces
Add documentation string.  Fix uninitialized f error.
2015-05-22 07:34:40 +02:00
Neil Booth d09d5e5dac Plain number formatting for URIs. 2015-05-22 14:32:47 +09:00
Neil Booth 4873c455b9 Add documentation string. Fix uninitialized f error.
Traceback (most recent call last):
      File "src/electrum/lib/network.py", line 411, in process_request
        out['result'] = f(*params)
    UnboundLocalError: local variable 'f' referenced before assignment
    [Network] network error local variable 'f' referenced before assignment
2015-05-22 14:14:06 +09:00
ThomasV 20ee265683 Merge pull request #1227 from kyuupichan/connecting_status
Set 'connecting' status in one place.
2015-05-22 07:11:33 +02:00
Neil Booth 05dd310431 Set 'connecting' status in one place.
Also means when switching to an already connected server our
status doesn't quickly change to connecting and back again.
2015-05-22 14:05:58 +09:00
ThomasV 6858016411 Merge pull request #1225 from kyuupichan/net-interface
Consistency in handling of self.interface
2015-05-22 06:58:50 +02:00
ThomasV b3f1f04312 Merge pull request #1224 from kyuupichan/netstartstop
Put common network start and stop code in one place.
2015-05-22 06:31:28 +02:00