Commit Graph

9070 Commits

Author SHA1 Message Date
SomberNight fc6cb70c80 socket.getaddrinfo on win32: do our own dns resolution outside the lock 2018-06-09 19:15:00 +02:00
SomberNight 7043d6907f follow-up prev 2018-06-08 20:31:04 +02:00
SomberNight 1d4ca34ca6 kivy: fix potential crash in on_resume
happened for me at least once, but for some reason kivy actually "ignored the exception", and simply printed a long trace into logcat, starting with:
WARNING:kivy:stderr: Exception ignored in: 'kivy.core.window._window_sdl2._WindowSDL2Storage.cb_event_filter'
2018-06-08 20:29:07 +02:00
SomberNight cad8e29ed7 kivy: when pressing "max" button, catch NoDynamicFeeEstimates 2018-06-08 18:55:25 +02:00
matejcik 208606beda trezor: do not rely on deprecated ckd_public (#4416) 2018-06-08 17:07:49 +02:00
Dev Random c6fce4b7cc do not actually compute the nested p2wsh-p2sh script if just estimating size (#4412) 2018-06-07 17:44:48 +02:00
SomberNight 610b37890f kivy: after deleting wallet, try to open saved wallet
saved wallet = "wallet that was last open during a graceful shutdown"

previously we would just try to open "default_wallet". now, if the deleted wallet is not the saved wallet, we open the saved wallet; else try to open "default_wallet". if "default_wallet" does not exist, as before, the wizard launches.
2018-06-06 19:38:59 +02:00
SomberNight ff7159495c kivy: save and open to last wallet
The previous code did not work as before the flow reaches the old save point window.wallet is set to None in on_stop.
2018-06-06 19:21:00 +02:00
Harm Aarts e57e55aad8 Remove explicit send calls, part deux (#4408)
* Rename synchronous_get to synchronous_send

This makes it more inline with the method 'send' of which
synchronous_send is the, well, synchronous version.

* Move protocol strings from scripts to network

This is again a small step in the right direction. The network module is
going to accumulate more and more of these simple methods. Once
everything is moved into that module, that module is going to be split.

Note that I've left the scripts which use scripts/util.py alone. I
suspect the same functionality can be reached when using just
lib/network.py and that scripts/util.py is obsolete.

* Remove protocol string from verifier and websocket

Websocket still has some references, that'll take more work to remove. Once the
network module has been split this should be easy.
I took the liberty to rename a variable to better show what it is.

* Remove protocol strings from remainder

The naming scheme I'm following for the newly introduced methods in the network
module is: 'blockchain.<subject>.<action>' -> def <action>_(for|to)_<subject>

* Move explicit protocol calls closer to each other

This makes it easier to keep track of the methods which are due to be
extracted.

* Remove `send` when using `get_transaction`

This is the final step to formalize (the informal) interface of the network
module.
A chance of note is changed interface for async/sync calls. It is no longer
required to use the `synchronous_send` call. Merely NOT passing a callback
makes the call synchronous. I feel this makes the API more intuitive to work
with and easier to replace with a different network module.

* Remove send from get_merkle_for_transaction

The pattern which emerged for calling the lambda yielded an slight refactor.
I'm not happy with the name for the `__invoke` method.

* Remove explict send from websockets

* Remove explicit send from scripts

* Remove explicit send from wallet

* Remove explicit sync_send from commands, scripts

* Remove optional timeout parameter

This parameter doesn't seem to be used a lot and removing it makes the
remaining calls easier. Potentionally a contentious choice!

* Rename `broadcast` to `broadcast_transaction`

Doing so makes the method name consistent with the other ElectrumX protocol
method names.

* Remove synchronous_send

Now every method is intuitive in what it does, no special handling required.
The `broadcast_transaction` method is weird. I've opted not to change the
return type b/c I found it hard to know what the exact consequences are. But
ideally this method should just works as all the other ElectrumX related
messages. On the other hand this shows nicely how you _can_ do something
differnt quite easy.

* Rename the awkwardly name `__invoke` method

The new name reflects what it does.

* Process the result of linter feedback

I've used flake8-diff (and ignored a couple of line length warnings).

* Rename tx_response to on_tx_response

This fell through the cracks when this branch was rebased.

* subscript_to_scripthash should be get_balance

An oversight while refactoring.

* Add missing return statement

Without this statement the transaction would have been broadcasted twice.

* Pass list of tuples to send not single tuple

* Add @staticmethod decorator

* Fix argument to be an array
2018-06-06 15:06:04 +02:00
ThomasV 0fb3d3c825 Merge pull request #4411 from kyuupichan/get_chunk
Stop using deprecated RPC blockchain.block.get_chunk
2018-06-06 09:13:06 +02:00
Neil Booth bc83fa8d68 Stop using deprecated RPC blockchain.block.get_chunk
Use blockchain.block.headers instead.  It's more flexible but
that flexibility is not used here.

Port of https://github.com/fyookball/electrum/commit/09798d6b20bb35bae745b1a74c2fac5bb24b700a
2018-06-06 10:58:57 +09:00
Neil e0a6b082d2 First message on an interface is server.version (#4407)
- Use server.ping to ping (valid as of protocol version 1.2) rather
  than server.version (deprecated as a ping)
- Ping every 5 mins rather than every 1 minute.  By default servers
  don't consider a connection stale until 10 minutes of inactivity.
- Remove unused last_request member of interface

Port of https://github.com/fyookball/electrum/commit/c3f26e59db9ce6d5af6c12510f1817d2782f4928
2018-06-05 12:41:41 +02:00
SomberNight f0daf2d37b Qt: addresses tab - align text 2018-06-04 22:37:34 +02:00
Johann Bauer 10c0746287 Make new status icons closer to their original color 2018-06-04 21:30:22 +02:00
SomberNight 792c248919 Qt: FeerateEdit.get_amount now returns sat/byte 2018-06-04 21:17:25 +02:00
SomberNight 9788ca0250 Qt: feerate edit was sometimes rounding inconsistently 2018-06-04 21:01:47 +02:00
ghost43 d667c5d46e Merge pull request #4402 from kyuupichan/master
Subscribe to raw headers
2018-06-04 17:15:49 +02:00
SomberNight 105101bb5c fix #4403 2018-06-04 17:07:50 +02:00
Neil Booth b164cc4bba Pass raw=True when subscribing to headers
Remove use of deprecated bitcoin address
2018-06-04 16:52:44 +09:00
Neil Booth 1900e58e88 Subscribe to raw headers
The old interface is deprecated

Port of https://github.com/fyookball/electrum/commit/fe303c97c3d737b3e6464124420609cd52b92254
2018-06-04 16:19:11 +09:00
SomberNight 219c2a363a fix #4401 2018-06-03 17:17:56 +02:00
SomberNight 3031f594cb scaled pixmaps no longer pixelated 2018-06-01 22:36:56 +02:00
SomberNight cfc52e6441 follow-up #4396: new 2fa wallets could not be created 2018-06-01 22:19:00 +02:00
SomberNight 141994ed1b tests: TestWalletSending - also test raw_tx and wtxid 2018-06-01 18:05:49 +02:00
ThomasV 8d07094ede Merge pull request #4396 from SomberNight/storage_upgrade_wizard
storage upgrade as part of the wizard. fix storage upgrade on kivy.
2018-06-01 13:22:10 +02:00
ThomasV 4fc677c876 Merge pull request #4394 from bauerj/new-icons
New icons
2018-06-01 09:39:03 +02:00
SomberNight 2b84fba67b storage upgrade as part of the wizard. fix storage upgrade on kivy. 2018-05-31 19:43:50 +02:00
Johann Bauer edb6de92d8 New icons 2018-05-31 17:26:52 +02:00
Johann Bauer d288999036 i18n template improvements 2018-05-31 11:05:44 +02:00
SomberNight ec5931ae54 rename dylib for libsecp
follow c76375de91
2018-05-30 22:50:03 +02:00
Johann Bauer 4a65db54c9 Travis: Fix Windows build from PRs 2018-05-30 22:29:51 +02:00
Johann Bauer c76375de91 Build libsecp256k1 2018-05-30 21:47:28 +02:00
SomberNight 1e06b1921e wallet.py: access unverified_tx with self.lock
Only actually needed due to Imported_Wallet.delete_address, but it takes some time to see this.
The verifier and the synchronizer both access unverified_tx but they are both run in the Network thread.
In any case, there does not seem to be a measurable performance hit when using the lock.
2018-05-30 19:01:47 +02:00
SomberNight 060404e17c wallet/verifier: persist wallet.verified_tx when verifier finishes
Previously verified_tx was only persisted in wallet.stop_threads(), hence only on clean shutdowns.
2018-05-30 18:21:29 +02:00
SomberNight 4159322db0 synchronizer.py: rename tx_response to on_tx_response 2018-05-30 17:35:29 +02:00
SomberNight ee9861f0d5 wallet.py: access verified_tx with lock 2018-05-30 13:24:58 +02:00
SomberNight 6bb7558f75 InvalidPassword undefined in wallet.py 2018-05-30 13:14:01 +02:00
SomberNight deb945d810 tests: TestWalletHistory_EvilGapLimit 2018-05-29 20:51:04 +02:00
SomberNight c34273b771 (minor) missing space in message when deleting wallet 2018-05-29 13:40:36 +02:00
SomberNight 9bd082cd82 trezor/keepkey: better handling of exceptions during device initialization
notably Trezor T is returning a different msg type when trying to get an xpub from an uninitialized device, which we are not handling. instead we should just realise ourselves that we did not initialize the device
2018-05-29 13:37:30 +02:00
Johann Bauer 46fcf686b1 Travis: Check if icons and locales are up to date on release 2018-05-29 00:00:37 +02:00
SomberNight 7218bf1d14 tests: bip32 extended version bytes 2018-05-28 20:27:08 +02:00
ghost43 9b7a449057 util.make_dir: 0o700 permissions on folders (#4357) 2018-05-28 14:22:54 +02:00
SomberNight dbec3af810 tests: introduce FAST_TESTS flag for faster local testing 2018-05-28 14:02:07 +02:00
SomberNight 1f373c1eb9 ecc: don't print trace when can't find libsecp 2018-05-28 02:28:01 +02:00
SomberNight 86992aea6c bundle libsecp256k1 in android apk
this works as there is already a p4a recipe upstream: https://github.com/kivy/python-for-android/blob/74bf788a293847c5d6966b2307ee68854d68015f/pythonforandroid/recipes/libsecp256k1/__init__.py
2018-05-28 00:43:05 +02:00
SomberNight 483a2a40cd wine-build: fetch pull requests from repo if can't find commit
follow-up 25089aa9c2
2018-05-27 04:25:11 +02:00
SomberNight facb7bbc0e ecc: (minor) use ECPubkey.from_point 2018-05-27 03:55:10 +02:00
SomberNight 25089aa9c2 travis: build-wine current commit, instead of HEAD 2018-05-27 02:35:23 +02:00
SomberNight ac94d6d055 ecc: ECPrivkey.sign clean-up 2018-05-26 19:26:13 +02:00