Commit Graph

4842 Commits

Author SHA1 Message Date
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
Neil Booth 86626d8080 Consistency in handling of self.interface
switch_to_interface() becomes the common place where
self.interface is set; therefore self.interface is not None
precisely when self.default_server is connected.  Previously some
places required it to be connected and some didn't.  Also an
interface change now sends the 'updated' notification
consistently - previously some did and some didn't.

Have network_start() call start_interfaces() - this also means
network restarts now do this.

Fix apparent off-by-one in start_interfaces()
2015-05-22 09:13:09 +09:00
Neil Booth c918e74039 Put common network start and stop code in one place.
Prefer to use safer self.is_connected() as it checks interface
is not None.

Using common code gives small observable changes in behaviour:

 - slightly different print_error() messages
 - network restarts now enter status 'connecting' which they
   didn't before, which seems correct
 - status 'connecting' is done with set_status() rather than
   simply assigning the status, which seems more correct.  Now
   that the response_queue is available in the constructor this
   works; it used to fail with 'response_queue is not defined'
2015-05-22 07:52:59 +09:00
ThomasV 8620019f92 Merge pull request #1222 from kyuupichan/if_notification
Put interface notification handling in its own function.
2015-05-21 15:05:07 +02:00
ThomasV 5bd22d2378 follow-up to bd781d600b8ce2bc9dcebebbdb0fb60ad2fb892e: use pipe 2015-05-21 12:50:26 +02:00
Neil Booth c9a30eb5f2 Put interface notification handling in its own function. 2015-05-21 17:45:37 +09:00
ThomasV 5841f943e8 Merge pull request #1219 from kyuupichan/network_queues
Have queues passed to the network constructor.
2015-05-21 10:40:25 +02:00
Neil Booth bd781d600b Have queues passed to the network constructor.
This is somewhat cleaner as the proxy's pipe and network setup
was awkwardly interleaved.  It also means network's constructor
is free to use both; currently some code is working around the
fact that the response queue doesn't exist in the constructor.
2015-05-21 12:49:39 +09:00
ThomasV cc17bb0090 close: use signal to close from gui thread 2015-05-20 09:15:52 +02:00
ThomasV 7b27f01e07 call fsync before rename 2015-05-19 11:56:33 +02:00
ThomasV 5c73bc5bc7 interface: init ping_time with 0 so that the client sends version message 2015-05-19 11:28:30 +02:00
ThomasV 2104e96a66 network: use get_nowait on one of the two queues 2015-05-19 10:22:25 +02:00
ThomasV 107cfc058d Merge pull request #1216 from kyuupichan/network-unthread
No need for thread to handle requests
2015-05-19 10:18:08 +02:00
Neil Booth 63733ccd2a No need for thread to handle requests
Handle requests in the main loop.
Remove unused lock.
interface.py was reworked and send_request() no longer throws.
2015-05-19 14:29:10 +09:00
ThomasV 18032fc4f6 treewidget: keep default label when editing 2015-05-17 12:48:17 +02:00
ThomasV 9bb44e4db3 change mouse cursor over qr code 2015-05-17 09:55:41 +02:00
ThomasV a0e9046c2c prepare for 2.2 release 2015-05-17 09:17:52 +02:00
ThomasV e33bc2473b network: don't store unanswered request if result is in cache 2015-05-17 09:00:36 +02:00
ThomasV 6d0bc5d9b3 fix: nodes retry 2015-05-17 08:41:01 +02:00
ThomasV 44f06de796 network: when interface is disconnected, clear cache and resend unanswered requests 2015-05-15 14:47:59 +02:00
ThomasV e927766698 Merge pull request #1211 from mikeland86/master
Fix createrawtransaction and add missing deserialize() calls
2015-05-13 15:18:03 +02:00
mikeland86 b80205e546 Merge pull request #1 from mikeland86/fix_-createrawtransaction
Fix createrawtransaction and missing deserialize() calls
2015-05-13 14:59:03 +02:00
mikeland86 0ec62c8f36 Fix createrawtransaction and missing deserialize()
Found these issues while trying to create, sign, and broadcast a raw transaction. 

* createrawtransaction was using old signature for Transaction constructor
* Signwithwallet and decoderawtransaction need to call deserialize on tx before they can access inputs and outputs. (Maybe adding getInputs() and getOutputs() which deserializes if needed might be nicer)
2015-05-13 14:57:34 +02:00
ThomasV 5fa2a48343 add getmerkle command 2015-05-12 12:30:26 +02:00
ThomasV 81be685644 remove tests broken after WalletStorage update 2015-05-11 11:59:39 +02:00
ThomasV 7e9153aaa4 test if labels exist before loop. don't raise if a label cannot be converted 2015-05-11 11:55:26 +02:00
ThomasV 5160f46ca1 fix proxy value in text gui 2015-05-11 08:19:19 +02:00