Commit graph

3190 commits

Author SHA1 Message Date
ThomasV
e50f6d29ed export channel backup from kivy gui 2020-04-10 20:04:24 +02:00
ThomasV
74517c88ad do not use short_channel_id as state, use channel state for that.
display it as soon as the funding tx is mined.
2020-04-10 15:10:50 +02:00
ThomasV
8f41aeb783 Replace wallet backup with channel backups
- channels can be backed up individually
 - backups are added to lnwatcher
 - AbstractChannel ancestor class
2020-04-10 14:45:23 +02:00
SomberNight
b6bac0182f
wizard hww: use exception handling to choose hw device again
- no need to pass args, caller knows what it wanted
- avoids deepening the call stack on every rescan
  (nicer tracebacks, no stack overflow)
2020-04-09 19:45:45 +02:00
SomberNight
71eed1d4cb
wizard: (trivial) add show_error to base class, document API 2020-04-09 19:45:42 +02:00
SomberNight
08a7925235
wizard.create_storage: state API and abide by it
none of the callers was handling the return None case properly...
2020-04-09 19:45:38 +02:00
SomberNight
a3e1b2e00c
wizard: hww creation flow: don't just swallow exception
if we just return here, the calling code will try to create the storage and fail
2020-04-09 19:45:35 +02:00
SomberNight
4b1d835304
wizard hww: scan devices fewer times and move away from GUI thread 2020-04-09 19:45:31 +02:00
SomberNight
01dac92e19
wizard: fix crash when decrypting wallet hw device
E | __main__ | daemon.run_gui errored
Traceback (most recent call last):
  File ".../electrum/run_electrum", line 379, in <module>
    d.run_gui(config, plugins)
  File "...\electrum\electrum\daemon.py", line 522, in run_gui
    self.gui_object.main()
  File "...\electrum\electrum\gui\qt\__init__.py", line 362, in main
    if not self.start_new_window(path, self.config.get('url'), app_is_starting=True):
  File "...\electrum\electrum\gui\qt\__init__.py", line 246, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\gui\qt\__init__.py", line 270, in start_new_window
    wallet = self._start_wizard_to_select_or_create_wallet(path)
  File "...\electrum\electrum\gui\qt\__init__.py", line 308, in _start_wizard_to_select_or_create_wallet
    path, storage = wizard.select_storage(path, self.daemon.get_wallet)
  File "...\electrum\electrum\gui\qt\installwizard.py", line 334, in select_storage
    pw_e.clear()
  File "...\electrum\electrum\gui\qt\util.py", line 759, in clear
    self.setText(len(self.text()) * " ")
RuntimeError: wrapped C/C++ object of type PasswordLineEdit has been deleted
2020-04-09 17:55:42 +02:00
ThomasV
5efaaa523a lnworker: check chain_hash when decoding channel update. 2020-04-09 15:16:07 +02:00
SomberNight
7c830cb221
wizard hww: move devmgr.scan_devices() away from GUI thread 2020-04-08 18:54:11 +02:00
SomberNight
7a4acb05f2
hww: fix threading issue in DeviceMgr: enumerate_func needs self.lock
E | gui.qt.main_window.[test_ms_p2wsh_2of3_cc3132_trezort_cc3133] | on_error
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\util.py", line 794, in run
    result = task.task()
  File "...\electrum\electrum\plugins\hw_wallet\qt.py", line 232, in trigger_pairings
    devices = devmgr.scan_devices()
  File "...\electrum\electrum\plugin.py", line 376, in func_wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugin.py", line 656, in scan_devices
    for f in self.enumerate_func:
RuntimeError: Set changed size during iteration
2020-04-08 18:46:28 +02:00
SomberNight
bf067f7558
HardwareClientBase: provide default implementation for label
and add warning about placeholders
2020-04-08 18:28:21 +02:00
SomberNight
db1ff4915f
hww: show model name in device enum lists (e.g. "Trezor T") 2020-04-08 17:53:40 +02:00
SomberNight
e1996bde01
hww: select_device: only update label/dev_id after pairing succeeds 2020-04-08 17:53:37 +02:00
SomberNight
4ef313a1ac
hww: smarter auto-selection of which device to pair with
scenario1:
- 2of2 multisig wallet with trezor1 and trezor2 keystores
- only trezor2 connected
- previously we would pair first keystore with connected device and then display error.
  now we will pair the device with the correct keystore on the first try

scenario2:
- standard wallet with trezor1 keystore
- trezor2 connected (different device)
- previously we would pair trezor2 with the keystore and then display error.
  now we will prompt the user to select which device to pair with (out of one)

related: #5789
2020-04-08 17:53:33 +02:00
SomberNight
9d0bb295e6
hww: distinguish devices based on "soft device id" (not just labels)
fixes #5759
2020-04-08 14:44:42 +02:00
SomberNight
7dabbdd082
tests_lnpeer: trivial fix 2020-04-08 13:18:56 +02:00
SomberNight
1ea89af012
crypto.pw_decode: fix one case of raising incorrect exception 2020-04-08 12:49:50 +02:00
SomberNight
789b78cab5
crypto: trivial clean-up of pw_encode/pw_decode functions 2020-04-08 12:38:38 +02:00
ghost43
b31efdc3e7
Merge pull request #6076 from JeremyRand/initial-download-exception
Use specific Exception when chain isn't synced
2020-04-08 08:34:40 +00:00
ThomasV
6307e13549 do not print the entire payment log again, this is redundant 2020-04-08 09:46:16 +02:00
JeremyRand
40389a21b6
Use specific Exception when chain isn't synced
Makes it easier for calling code to know what error happened.
2020-04-08 03:09:08 +00:00
SomberNight
caefea19dd
trezor pin dialog: only show PIN "strength" when creating/changing
fixes #4832
2020-04-07 18:58:45 +02:00
SomberNight
5259fcb6fd
qt PasswordLineEdit: try to clear password from memory
If an attacker has access to the process' memory, it's probably already game over,
still we can make their life a bit harder.

I really tried but failed to encapsulate this logic inside PasswordLineEdit.
The destroyed signal arrives too late.
deleteLater is not called.
__del__ gets called too late.
2020-04-07 18:58:42 +02:00
SomberNight
c798e5d9a1
qt: introduce PasswordLineEdit(QLineEdit) 2020-04-07 18:58:37 +02:00
ghost43
4d980cd4bd
Merge pull request #6064 from matejcik/trezor-0.12-passphrase
trezor: bump lib version, implement new passphrase-on-device UI
2020-04-06 17:53:59 +00:00
SomberNight
fb5382f75f
follow-up prev (typo) 2020-04-06 19:49:56 +02:00
ThomasV
d2a58a2ec3 lnpeer: do not assume our privkey is the same as lnworker's privkey. 2020-04-06 19:06:27 +02:00
ThomasV
55d0a9587e move maybe_save_short_chan_id to lnchannel 2020-04-06 18:35:12 +02:00
ThomasV
f3995350e8 localconfig: rename seed to channel_seed 2020-04-06 16:53:48 +02:00
SomberNight
08bc8617ad
change derivation of ln channel keys: use hardened paths 2020-04-06 12:53:57 +02:00
ThomasV
0ea21c59d2 Save channel seed in localconfig 2020-04-04 13:28:19 +02:00
SomberNight
1dc3100ba3
android build: use "cryptography" instead of "pycryptodomex" fork
Electrum needs either "cryptography" or "pycrytodomex" (since #6014).
Previously we have been using a custom fork (of ours) of pycryptodomex,
now let's just use upstream "cryptography".
2020-04-04 01:43:00 +02:00
SomberNight
f777c9ee13
android build: update buildozer/p4a/NDK
- updated p4a pulls in newer openssl (old one is no longer available from openssl.org)
- old NDK no longer available (new one is what updated p4a recommends)
2020-04-04 01:42:57 +02:00
SomberNight
f412420892
include lnwire csv files in binaries (follow-up #6050) 2020-04-04 01:40:05 +02:00
SomberNight
f13f46c555
qt wizard: make "GoBack" unroll the call stack to avoid stack overflow
fixes #6069
2020-04-03 18:58:51 +02:00
ThomasV
aa32e31a3d follow-up previous commit 2020-04-03 18:54:02 +02:00
ThomasV
06dfe1699c LNWatcher: Distinguish between blockchain-triggered channel state
transitions, and actions taken as a result.
- state transitions are performed in lnchannel.update_onchain_state()
- peer actions are in LNWorker.on_channel_update()
2020-04-03 17:34:11 +02:00
ThomasV
9ca445bd5d save_short_chan_id: remove unneeded ćalls to lnwatcher 2020-04-03 12:59:56 +02:00
ThomasV
c8f602c9d7 pw_decode, pw_encode: separate bytes functions 2020-04-03 12:29:55 +02:00
ThomasV
764c18b3c8 follow-up prev commit 2020-04-02 17:36:18 +02:00
ThomasV
5067166e1e move should_channel_be_closed_due_to_expiring_htlcs into Channel class 2020-04-02 17:18:50 +02:00
SomberNight
1cdff09ead
follow-up 371f55a0f9 2020-04-02 14:39:01 +02:00
SomberNight
eecdd056b3
lnmsg: small speed-up: read first, check length after
this saves around ~13% wall clock time in ChannelDB.load_data
2020-04-01 21:49:23 +02:00
SomberNight
71635216df
ln feature bits: validate transitive feature deps everywhere 2020-04-01 21:49:19 +02:00
SomberNight
94e3c078f8
lnaddr: small clean-up 2020-04-01 21:49:16 +02:00
SomberNight
1be0a710c3
ln: implement option payment_secret 2020-04-01 21:49:12 +02:00
SomberNight
d424487814
lnpeer: better error handling when processing onion packets 2020-04-01 21:47:45 +02:00
SomberNight
30bf32b34b
use option varonion: actually use TLV payloads, and signal support 2020-04-01 21:47:42 +02:00