Commit Graph

13605 Commits

Author SHA1 Message Date
ThomasV a67fcdbc8a channels_list: use icon to tell apart channels from backups 2021-03-23 14:06:28 +01:00
ThomasV 62a95c4b94 lnchannel: add pseudo-state force_close_detected for GUI 2021-03-23 12:03:14 +01:00
ThomasV 763ee86028 lnwatcher: trigger 'verified' callback with the main wallet object.
This is a temporary fix; we should not use an extra synchronizer, and persist results.
2021-03-23 11:05:05 +01:00
ThomasV f7d2a33d45 set initial trampoline fee level to 1 unless we are testing 2021-03-22 17:04:01 +01:00
ThomasV c3221f7bfe (temporary) disable e2e and dual trampoline if first trampoline is ACINQ 2021-03-22 16:23:01 +01:00
ThomasV 0f4297cfa8 fix direct payment to trampoline node 2021-03-22 13:17:50 +01:00
ThomasV f8804b29c9 (minor) fix mutable default value 2021-03-22 11:50:01 +01:00
ThomasV aa1fcc784e wallet: store wanted_height in future_tx, instead of remaining blocks 2021-03-22 11:00:42 +01:00
SomberNight 03d9b29eee lntransport: optimise read_messages implementation
Not great to use a 'bytes' object as a FIFO buffer, as every slice copies the whole thing.
With bytearray, extending it from the right is fast,
and with the correct syntax, popping from the left is fast too.

see https://stackoverflow.com/a/57748513
https://bugs.python.org/issue19087
https://github.com/python/cpython/commit/5df8a8a1fd6cc6f4469dc7d3994d06e2aea24c52
2021-03-21 22:19:37 +01:00
SomberNight 4f13c451c7 tests: rework lntransport test a bit
send multiple messages, and not only short ones
2021-03-21 22:11:16 +01:00
ThomasV 1a49fd440d kivy: add option to request force-close 2021-03-21 15:26:17 +01:00
ThomasV 22e6fe09c1 Merge pull request #7125 from verretor/2021-03-style
Minor style changes
2021-03-21 06:36:47 +01:00
Benoit Verret f731c38293 Minor style changes 2021-03-21 00:36:23 -04:00
gruve-p 9609a60ab6 Rename excluce to exclude (#7121) 2021-03-20 18:26:58 +00:00
SomberNight beba807cfe qt ChannelsList: fix opening channel with "max" amount 2021-03-20 19:20:49 +01:00
SomberNight d86c45edac dependencies: bump min aiorpcx, and enforce at runtime
Note that newer aiorpcx started requiring python 3.8, so we cannot use
the latest versions, until we too bump the min python version to 3.8.
We should not do that until debian stable ships python 3.8.
Also, new aiorpcx introduced some API changes which we will need to
adopt, so even if the user locally has recent enough python, we need
old aiorpcx atm.

related: https://github.com/spesmilo/electrum/issues/7118
2021-03-20 17:17:32 +01:00
ThomasV aad392f6ff lnworker: filter active channels in create_routes_for_payment 2021-03-20 13:53:46 +01:00
ThomasV 0121cbcbbe pay_to_route: raise PaymentFailure in case of dropped peer, so that we reset payment status 2021-03-20 10:12:49 +01:00
ThomasV bbb9ce2430 lnwatcher.try_redeem: output log only the first time a tx is seen 2021-03-20 09:30:15 +01:00
ThomasV aba0bad30c lnwatcher: try_redeem must return if tx is None 2021-03-20 09:10:48 +01:00
SomberNight 65e16fabd2 follow-up d8352f1a0a
message-induced exceptions should not propagate out
2021-03-19 21:21:09 +01:00
SomberNight c912036180 lnpeer: ignore unknown 'odd' type messages
from BOLT-01:
A receiving node:
  - upon receiving a message of odd, unknown type:
    - MUST ignore the received message.

https://github.com/lightningnetwork/lightning-rfc/blob/b201efe0546120c14bf154ce5f4e18da7243fe7a/01-messaging.md#lightning-message-format
2021-03-19 20:51:38 +01:00
SomberNight d8352f1a0a lnworker: nicer logs/error msgs for payment failure
try to decode onion error and log it in human-readable form
2021-03-19 19:13:50 +01:00
ThomasV 2509eaa642 Qt: clarify use_gossip checkbox text 2021-03-19 14:07:04 +01:00
ThomasV 27dcfba98d channels_list: improve menu for backups 2021-03-19 13:57:17 +01:00
ThomasV afcc695f4d channels_list: show backup text in the state column. fix missing import in previous commit. 2021-03-19 13:35:12 +01:00
ThomasV 2fee920f43 On Android, if channels are not recoverable, display channel backup when a new channel is created.
Remove the 'android_backups' setting, which was unpractical.
2021-03-19 13:17:58 +01:00
ThomasV 5ec1f7b398 bump version number. initial release notes for version 4.1.0 2021-03-19 10:45:17 +01:00
ThomasV 64a931f21e Deterministic NodeID:
- use_recoverable_channel is a user setting, available
   only in standard wallets with a 'segwit' seed_type
 - if enabled, 'lightning_xprv' is derived from seed
 - otherwise, wallets use the existing 'lightning_privkey2'

Recoverable channels:
 - channel recovery data is added funding tx using an OP_RETURN
 - recovery data = 4 magic bytes + node id[0:16]
 - recovery data is chacha20 encrypted using funding_address as nonce.
   (this will allow to fund multiple channels in the same tx)

GUI:
  - whether channels are recoverable is shown in wallet info dialog.
  - if the wallet can have recoverable channels but has an old node_id,
    users are told to close their channels and restore from seed
    to have that feature.
2021-03-19 10:17:02 +01:00
ThomasV e3025b3d7b lnpeer: send update_fee if channel was never used (workaround eclair issue 1730) 2021-03-19 07:23:51 +01:00
SomberNight 9bb39833cc lnpeer: add sanity checks in channel open flow re ln dummy output 2021-03-18 19:13:33 +01:00
ThomasV bf5aa1d690 Merge pull request #7113 from bitromortac/2103-temp-chan-fail
forwarding: temp chan fail on insufficient funds
2021-03-18 10:47:03 +01:00
ThomasV 043a264fb7 Merge pull request #7114 from benma/bb02
bitbox02: bump dependency to 5.2.0
2021-03-18 10:45:38 +01:00
Marko Bencun a16fdd54a8 bitbox02: bump dependency to 5.2.0 2021-03-18 09:45:15 +01:00
ThomasV 9e6996c5c1 qt: use 'local' icon for future transactions 2021-03-18 09:21:36 +01:00
bitromortac f1b5069c78 forwarding: temp chan fail on insufficient funds
When forwarding an HTLC and the outgoing channel doesn't have
enough funds or other transient issues, we are failing the
HTLC with a temporary channel failure.

From BOLT #04:
* if during forwarding to its receiving peer, an otherwise unspecified,
transient error occurs in the outgoing channel (e.g. channel capacity
reached, too many in-flight HTLCs, etc.):
-> return a temporary_channel_failure error.
2021-03-18 08:27:48 +01:00
ThomasV 8a051dcd76 lnworker: use booleans for enable_htlc_settle, enable_htlc_forwarding 2021-03-18 07:48:30 +01:00
ThomasV e5686c8dc5 test_backup: sleep is not needed anymore 2021-03-18 07:26:33 +01:00
SomberNight 3ea27beb4e daemon: change stop() to use events, instead of polling 2021-03-17 19:42:20 +01:00
SomberNight 5dfe1d1b6c commands: make stop() CLI cmd wait for daemon to stop 2021-03-17 19:42:16 +01:00
ThomasV 8870ed7cc5 test_backup: check onchain balance 2021-03-17 19:20:33 +01:00
ThomasV aa58e270c7 increase width of tx dialog, to have one line per input 2021-03-17 18:35:14 +01:00
SomberNight 4315fa4371 BIP-0350: use bech32m for witness version 1+ addresses
We have supported sending to any witness version since Electrum 3.0, using
addresses as specified in BIP-0173 (bech32 encoding).
BIP-0350 makes a breaking change in address encoding, and recommends using
(and using only) a new encoding (bech32m) for sending to witness version 1
and later. The address encoding for currently in use witness v0 addresses
remains the same, as in BIP-0173; following the BIP-0350 spec.

closes https://github.com/spesmilo/electrum/issues/6949

related:
https://github.com/bitcoin/bips/blob/cd3885c0fb9d140b111ff729294400ff5dcfc8e3/bip-0350.mediawiki
https://github.com/bitcoin/bitcoin/pull/20861
2021-03-17 18:11:55 +01:00
SomberNight 468636eae0 tests: add missing test vectors from BIP-0173 (bech32) 2021-03-17 17:13:10 +01:00
ThomasV cd025c5553 inspect_tx_candidate: tx output must be of address type 2021-03-17 15:55:53 +01:00
ThomasV e954bfaa54 request_force_close: close and reopen existing peer connection,
because channel_reestablish cannot be sent twice in the same session
2021-03-17 15:36:21 +01:00
ThomasV 1c8c236933 channels_with_funds: self._channels -> self.channels 2021-03-17 13:50:57 +01:00
ThomasV 8d8f078544 Merge pull request #7107 from bitromortac/2103-trampoline-mpp-single
mpp_split: use single nodes for mpp payments over trampoline
2021-03-17 13:47:13 +01:00
SomberNight 16f874b58e network: trigger 'network_updated' as soon as set_parameters finishes
e.g. kivy GUI refreshes some fields based on this callback;
this should result in faster refreshes
(otherwise e.g. when switching servers, a callback might only come if
we successfully connect to the new server; or if an unrelated event
triggers it)
2021-03-17 13:40:27 +01:00
ThomasV ef42d26cbf qt channels_list: separate on_success handlers for close_channel and request_force_close 2021-03-17 09:32:34 +01:00