Commit Graph

4778 Commits

Author SHA1 Message Date
ThomasV 6035fe974c Merge pull request #1207 from kyuupichan/offline-final
Don't use self.network to get the local height.
2015-05-08 08:09:18 +02:00
Neil Booth 13b9b577a4 Don't use self.network to get the local height.
This restores a working offline mode.
2015-05-08 14:45:23 +09:00
ThomasV 56f855b7ef Merge branch 'kyuupichan-offline-2' 2015-05-08 07:39:24 +02:00
ThomasV e06b3ba3ce Merge branch 'offline-2' of https://github.com/kyuupichan/electrum into kyuupichan-offline-2 2015-05-08 07:32:48 +02:00
ThomasV 60be02dace Merge pull request #1205 from kyuupichan/if-cleanup-final
Fix two races in interface.py.
2015-05-08 07:01:27 +02:00
Neil Booth 37c3cce329 Remove wallet.get_transactions()
Because references are returned, it's not threadsafe as ThomasV
pointed out.
2015-05-08 09:31:45 +09:00
Neil Booth 97b5f6d6a3 Fix two races in interface.py.
First, close the socket from the thread itself rather than from
the stop() function.  This prevents another thread closing the
socket that the interface thread is simultaneously using.

Second, it occasionally would happen that the parent thread such as
network.py start() an interface, do a send_request() and timeout
waiting for a response (timeouts are 0.1s).  It would check
is_connected(), get False, and assume the connection has failed.
In fact the thread hadn't even been scheduled or gotten around to
completing the socket connection.  Fix by having self.connected
start out True.  If the connection fails or times out, we set
connected to False soon enough.

Finally for correctness we need to deepcopy a send_request() rather
than take a reference to it.
2015-05-08 07:32:31 +09:00
Neil Booth a47881d72b Move the verified and unverified txs to the wallet. 2015-05-07 23:54:39 +09:00
ThomasV 656560be72 show many address labels in tx default label. fixes #1200 2015-05-07 16:09:39 +02:00
ThomasV 414d0e1fa1 Merge pull request #1202 from kyuupichan/offline-1
Preparation for moving the set of verified and unverified txs to the wallet
2015-05-07 15:25:09 +02:00
Neil Booth 79de458101 Preparation for moving the set of verified and unverified txs to the wallet.
The verifier will retain responsibility for verification, but will no longer
hold the transaction sets itself.

Change requires_fee to take a wallet.
Add new function add_unverified_tx()
Move get_confirmations() to the wallet from the verifier.
2015-05-07 09:21:08 +09:00
ThomasV ffda5cd866 Merge pull request #1187 from kyuupichan/local_height
Move away from requiring network and blockchain objects to be able to re...
2015-05-06 17:45:42 +02:00
ThomasV 8656785aa7 fix: use request_time for interface timeout 2015-05-06 17:25:29 +02:00
ThomasV 45fd3ef343 interface: send from same thread and simplify timeouts 2015-05-06 16:42:18 +02:00
ThomasV 78f5dbb72e revert c64e0c0e64 2015-05-06 12:13:21 +02:00
ThomasV 241b3b073f Merge pull request #1198 from kyuupichan/if-cleanup7b
Move response getting to its own function.
2015-05-06 11:28:03 +02:00
Neil Booth 6171779442 Move response getting to its own function.
This makes the operation of run() more clear.
No essential change in functionality.
2015-05-06 14:35:55 +09:00
ThomasV 43b8e202fd replace instances of get_unspent_coins 2015-05-06 07:25:50 +02:00
ThomasV a99c2bc9fa less verbose debug message 2015-05-05 21:00:35 +02:00
ThomasV 9d747fb601 Merge branch 'master' of git://github.com/spesmilo/electrum 2015-05-05 20:52:28 +02:00
ThomasV 687cc7783f show unmatured coins in status bar. fixes #1163 2015-05-05 20:52:14 +02:00
ThomasV 56e3c3cc68 Merge pull request #1195 from kyuupichan/if-cleanup6
Remove self.lock
2015-05-05 15:04:45 +02:00
ThomasV 4bce96526b follow up to c07e956127 2015-05-05 14:59:56 +02:00
Neil Booth 0cfcd2c7b2 Remove self.lock
It is now unused; all necesary locking is done by the Queue objects.
2015-05-05 21:57:07 +09:00
ThomasV 8eaa156595 Merge pull request #1194 from kyuupichan/if-cleanup5
Send requests only from the interface thread.
2015-05-05 14:54:51 +02:00
Neil Booth c64e0c0e64 Send requests only from the interface thread.
Currently requests are sent from the requestor's thread.  The lock is
not properly held where necessary so this is not thread-safe.  For example
it can race with the thread stopping and closing the socket the
requestor is trying to use to send with.

Resolve such races by having send_request() simply queue the requests,
which are asynchronously sent from the interface thread itself.
2015-05-05 21:36:34 +09:00
ThomasV 583d36a763 Merge pull request #1193 from kyuupichan/if-cleanup4
Move ping functionality into its own function.
2015-05-05 14:35:03 +02:00
Neil Booth 6920747a5d Move ping functionality into its own function.
First step in cleaning up the run() function.
Calls stop() rather than setting is_connected to False on
case of timeout, which cleanly closes the socket.
2015-05-05 20:46:34 +09:00
ThomasV 3b357b6a6d Merge pull request #1192 from kyuupichan/if-cleanup3
Pass the response_queue to the constructor, not start().
2015-05-05 13:44:42 +02:00
Neil Booth c07e956127 Pass the response_queue to the constructor, not start().
Removes an unnecessary Thread base-class override.  The python
documentation also strongly discourages overriding anything other
than run().
2015-05-05 20:37:25 +09:00
ThomasV d6b2cdd595 Merge pull request #1191 from kyuupichan/if-cleanup2
Make is_connected into a member function.  No change in logic.
2015-05-05 13:33:35 +02:00
Neil Booth 9cf2eff16b Make is_connected into a member function. No change in logic. 2015-05-05 20:00:10 +09:00
ThomasV 5e2e82d516 Merge pull request #1189 from kyuupichan/if-cleanup
First of several incremental patches tightening up interface.py.
2015-05-05 12:45:42 +02:00
ThomasV 1fcd8de290 Merge pull request #1190 from kyuupichan/icons
Fix two icons.
2015-05-05 12:39:35 +02:00
Neil Booth 1492610429 Fix two icons.
Solves the following warning every time electrm is run:

libpng warning: iCCP: known incorrect sRGB profile

There is lots of information about this on the internet, see e.g.

  https://wiki.archlinux.org/index.php/Libpng_errors
2015-05-05 14:54:02 +09:00
Neil Booth 4d55cb9528 First of several incremental patches tightening up interface.py.
Remove some unneeded imports, a constant and a line of dead code.
Document the current external API interface.py provides.
2015-05-05 14:02:51 +09:00
Maran 327c1bafd9 Use TLS for LabelSync 2015-05-04 12:20:52 +02:00
Neil Booth 175bfae9e6 Move away from requiring network and blockchain objects to be able to request local height.
We store it in the config object instead of in the blockchain object.
The blockchain object now refers to its config, and calls refresh_height() to update it.
The network objects also refer to the config rather than the blockchain.

This is the first of many small steps to untangle the verifier from stored state and so
permit the history tab to work in offline mode.  The refactoring will simultaneously clean
up a lot of accumulated cruft.
2015-05-03 15:19:29 +09:00
ThomasV 0a1c8f5546 underline help label 2015-05-03 07:06:54 +02:00
ThomasV 25c6a78ae0 fix missing immport 2015-05-02 16:29:41 +02:00
ThomasV 475a48091f Merge pull request #1183 from kyuupichan/get_history2
Make it 3-step instead of four. Avoid quadratic insertions.
2015-05-02 16:28:18 +02:00
ThomasV e4038dcdba move create_csr to gui 2015-05-02 16:26:27 +02:00
Neil Booth 2fc38332e7 Make it 3-step instead of four. Avoid quadratic insertions.
This is preparation to hopefully fix #1163
2015-05-02 23:17:50 +09:00
ThomasV 6527eae32b handle adds is None in tx dialog 2015-05-02 16:17:50 +02:00
ThomasV bbaacef960 fix format_satoshis for None values 2015-05-02 15:12:00 +02:00
ThomasV 51b62c2983 strip transaction text before parsing 2015-05-02 14:40:47 +02:00
ThomasV 9f4a914526 change mouse cursor over clickable labels 2015-05-02 13:36:10 +02:00
ThomasV 617fb36b06 minor fix: index 2015-05-02 11:21:19 +02:00
ThomasV afa814a444 small fix exchange_rates 2015-05-02 11:08:35 +02:00
ThomasV 75ddc066bb fix #1181 2015-05-02 11:05:38 +02:00