Commit graph

12110 commits

Author SHA1 Message Date
SomberNight
c7704fb8ee
lnworker: allow changing labels of chan-open/chan-close txns 2020-03-02 04:30:06 +01:00
SomberNight
5ac01ff6ae
ChannelDB: fix get_recent_peers 2020-03-02 02:19:13 +01:00
SomberNight
968eeebdc0
transaction: follow-up prev
makes more sense to special-case deserialize()
and not invoke the extra logic then
2020-03-01 22:08:18 +01:00
SomberNight
8560930bac
transaction: (fix) invalidate ser cache when changing locktime/version
we can keep the same API, using @property,
instead of introducing getters and setters
2020-03-01 09:57:59 +01:00
SomberNight
3090cc68bb
Qt tx dialog: show txid as "unknown" while not finalized 2020-03-01 09:32:05 +01:00
SomberNight
6f2cd8b4f5
Qt tx dialog: allow setting custom locktime
closes #2405
closes #1685
2020-03-01 09:14:50 +01:00
SomberNight
d8180c678b
Qt addresses list: show derivation path in tooltip (also addr dialog)
related: #5641
2020-03-01 05:45:15 +01:00
SomberNight
09b3c80529
Qt main_window: handle event 'ln_gossip_sync_progress' if LN disabled
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 434, in on_network_qt
    self.update_lightning_icon()
  File "...\electrum\electrum\gui\qt\main_window.py", line 2091, in update_lightning_icon
    self.lightning_button.setMaximumWidth(25 + 4 * char_width_in_lineedit())
AttributeError: 'ElectrumWindow' object has no attribute 'lightning_button'
2020-03-01 04:28:13 +01:00
SomberNight
4682c3a9fc
Qt history list: add tooltip for "local" transactions
closes #5473
2020-03-01 04:19:11 +01:00
SomberNight
e81283969c
Qt ln tx dialog: small fixes 2020-03-01 03:59:26 +01:00
SomberNight
0147623d11
lnpeer: Peer.is_initialized() should not raise
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 434, in on_network_qt
    self.update_lightning_icon()
  File "...\electrum\electrum\gui\qt\main_window.py", line 2092, in update_lightning_icon
    cur, total = self.network.lngossip.get_sync_progress_estimate()
  File "...\electrum\electrum\lnworker.py", line 373, in get_sync_progress_estimate
    if self.num_peers() == 0:
  File "...\electrum\electrum\lnworker.py", line 202, in num_peers
    return sum([p.is_initialized() for p in self.peers.values()])
  File "...\electrum\electrum\lnworker.py", line 202, in
    return sum([p.is_initialized() for p in self.peers.values()])
  File "...\electrum\electrum\lnpeer.py", line 128, in is_initialized
    return self.initialized.done() and self.initialized.result() is True
concurrent.futures._base.CancelledError
2020-02-29 20:10:02 +01:00
SomberNight
67d24bf129
add LN gossip sync progress estimate indicator to Qt GUI 2020-02-29 20:03:35 +01:00
SomberNight
fd56fb9189
ChannelDB: add self.lock and make it thread-safe 2020-02-29 20:03:31 +01:00
SomberNight
1ca6f6f306
Qt address list speedup: wallet.is_beyond_limit was slow 2020-02-29 07:28:13 +01:00
SomberNight
a0b096dcb2
mnemonic: implement Wordlist class
Wordlist subclasses 'tuple' so it can be transparently used.
'in' and '.index()' are fast.
Use Wordlist in bip39_is_checksum_valid, which makes that faster.
2020-02-29 00:20:11 +01:00
SomberNight
e1dcdde272
Qt tx dialog: fix file extension when exporting (on MacOS...)
closes #5954

We are now giving every(?) hint possible to the MacOS file dialog...
The extension is put in the filename as before (which turned out not to be enough).
It is also set using QFileDialog.setDefaultSuffix, which again, turns out not to be enough.
In desperation, the file extension filter-list now contains *.psbt and *.txn as separate filters,
and the one with the expected extension is pre-selected. This seems enough...
2020-02-28 21:59:09 +01:00
SomberNight
a32af44ff9
trivial clean-up (typing/imports) 2020-02-28 20:27:35 +01:00
SomberNight
02fcc6f570
wallet_db.get_transaction: tolerate if tx_hash is None
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 1503, in do_pay
    self.do_pay_invoice(invoice)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1516, in do_pay_invoice
    self.pay_onchain_dialog(self.get_coins(), outputs)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1570, in pay_onchain_dialog
    self.preview_tx_dialog(make_tx=make_tx,
  File "...\electrum\electrum\gui\qt\main_window.py", line 1574, in preview_tx_dialog
    d = PreviewTxDialog(make_tx=make_tx, external_keypairs=external_keypairs,
  File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 654, in __init__
    self.update()
  File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 392, in update
    tx_details = self.wallet.get_tx_info(self.tx)
  File "...\electrum\electrum\wallet.py", line 486, in get_tx_info
    tx_we_already_have_in_db = self.db.get_transaction(tx_hash)
  File "...\electrum\electrum\json_db.py", line 44, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet_db.py", line 822, in get_transaction
    assert isinstance(tx_hash, str)
AssertionError

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\confirm_tx_dialog.py", line 65, in timer_actions
    self.update()
  File "...\electrum\electrum\gui\qt\transaction_dialog.py", line 392, in update
    tx_details = self.wallet.get_tx_info(self.tx)
  File "...\electrum\electrum\wallet.py", line 486, in get_tx_info
    tx_we_already_have_in_db = self.db.get_transaction(tx_hash)
  File "...\electrum\electrum\json_db.py", line 44, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet_db.py", line 822, in get_transaction
    if tx_hash is None:
AssertionError
2020-02-28 20:23:50 +01:00
SomberNight
f8ba660583
clean-up hw-wallet "get_password_for_storage_encryption"-related code 2020-02-28 19:47:56 +01:00
SomberNight
88650ed8d6
network UntrustedServerReturnedError: add "DO NOT TRUST..." tag 2020-02-28 18:47:12 +01:00
ThomasV
55a0043ab7 follow-up previous commit (fix tests) 2020-02-28 10:34:04 +01:00
ThomasV
97900c0985 store raw messages in gossip_db. Fixes #5960 2020-02-28 10:22:49 +01:00
ThomasV
077f778632 Replace lightning_settle_delay with enable_htlc_settle (asyncio.Event) 2020-02-28 10:15:28 +01:00
SomberNight
ce81957d25
blockchain: move init_headers_file from network.py to blockchain.py
and don't run it every time the network restarts
2020-02-27 20:45:29 +01:00
SomberNight
b21bcf5977
taskgroups: don't log CancelledError 2020-02-27 20:22:49 +01:00
ThomasV
15e91169c5 lnpeer: fix json serialization of funding_inputs 2020-02-27 19:51:16 +01:00
ThomasV
8f6fc5917a make sure we can send shutdown 2020-02-27 19:19:10 +01:00
SomberNight
ed234d3444
rename all TaskGroup() fields to "taskgroup"
for consistency
2020-02-27 19:13:56 +01:00
SomberNight
c8260249b0
lnworker: add own taskgroup (run in daemon.taskgroup) 2020-02-27 19:13:53 +01:00
ThomasV
0bf09d14a0 fix regression in shutdown (from 1c5dc79298) 2020-02-27 19:01:06 +01:00
ThomasV
34400c0710 Set channel state to OPENING as soon as we receive 'funding_signed',
instead of when the funding transaction has been broadcast, because
we have no reliable way to know when it will be broadcast.
2020-02-27 18:12:20 +01:00
ThomasV
d04b8c05e2 (minor) fix typo in comment 2020-02-27 14:48:08 +01:00
ThomasV
f5053cc242 follow-up e54c69b861: we must settle HTCLs after during shutdown 2020-02-27 14:40:58 +01:00
ThomasV
e159b1d468 test_close: add unsettled htlc (fails with the current code) 2020-02-27 13:41:40 +01:00
SomberNight
c744fc4e3d
follow-up prev: do all checks, and add tests 2020-02-27 05:13:31 +01:00
SomberNight
a987a2bbbe
keystore: make add_key_origin "API-user-friendly"
Power-users that know what they are doing can use this method
to populate key origin information for keystore (bip32 root fingerprint
and derivation path prefix).
Try to make method hard to misuse.

Qt console can now be used as e.g.:
```
wallet.get_keystores()[2].add_key_origin(derivation_prefix="m/48h/1h/0h/2h", root_fingerprint="deadbeef")
```

related #5715
related #5955
related #5969
2020-02-27 04:18:27 +01:00
SomberNight
bea038ea6b
Qt tx dialog: warn if user asked for full bip32 paths but info missing
related: https://github.com/spesmilo/electrum/issues/5969#issuecomment-591441399

Instead of a log line, maybe it should warn as part of the GUI.. but this is a start.
2020-02-27 03:31:14 +01:00
SomberNight
22861b70ee
Qt tx dialog: make "export with xpubs" option always available
not just if one of the keystores is a coldcard

related: https://github.com/spesmilo/electrum/issues/5969#issuecomment-591441399
2020-02-27 03:14:13 +01:00
SomberNight
6703521f56
rm more cruft from test_lnchannel
follow-up e54c69b861
2020-02-27 02:53:03 +01:00
SomberNight
6161853941
lnpeer: reduce log spam due to incompatible feature bits 2020-02-26 21:10:33 +01:00
SomberNight
e54c69b861
add lnchannel.can_send_ctx_updates. just drop illegal updates for now 2020-02-26 20:35:46 +01:00
SomberNight
9d1fa4cc99
(trivial) lnworker: move LNGossip.peer_closed to parent class 2020-02-26 20:31:51 +01:00
ThomasV
3d0c1dbd5c restore log lines for send_commitment, on_commitment_signed 2020-02-26 19:14:49 +01:00
ThomasV
87fe2c7d7a define channel.has_pending_changes method 2020-02-26 19:08:48 +01:00
ThomasV
1c5dc79298 shutdown:
- resend shutdown on reestablish
 - wait until no more pending updates before sending shutdown
2020-02-26 16:06:28 +01:00
ThomasV
9b97469598 (minor) follow-up previous commit 2020-02-26 15:49:55 +01:00
ThomasV
6833adf8b6 simplify previous commit (revert changes on transaction.py) 2020-02-26 14:16:21 +01:00
ThomasV
e85fb25146 lnpeer: verify signature in closing_signed 2020-02-26 12:58:40 +01:00
ThomasV
0848aa259d (minor) simplification 2020-02-26 11:30:19 +01:00
ThomasV
d5c03307c3 the funder sends the first 'closing_signed' message 2020-02-26 11:15:03 +01:00