Commit graph

113 commits

Author SHA1 Message Date
SomberNight
8e8ab775eb
lnchannel: make AbstractChannel inherit ABC
and add some type annotations, clean up method signatures
2020-04-13 15:57:53 +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
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
ThomasV
aa32e31a3d follow-up previous commit 2020-04-03 18:54:02 +02:00
SomberNight
71635216df
ln feature bits: validate transitive feature deps everywhere 2020-04-01 21:49:19 +02:00
SomberNight
1be0a710c3
ln: implement option payment_secret 2020-04-01 21:49:12 +02:00
SomberNight
30bf32b34b
use option varonion: actually use TLV payloads, and signal support 2020-04-01 21:47:42 +02:00
SomberNight
4b78bf94d4
lnaddr: add feature bit support to invoices
see https://github.com/lightningnetwork/lightning-rfc/pull/656
2020-04-01 21:42:52 +02:00
SomberNight
a66437f399
lnonion: implement basis of varonion support 2020-04-01 21:42:48 +02:00
SomberNight
6ba08cc8d4
ln feature bits: flatten namespaces, and impl feature deps and ctxs
This implements:
- flat feature bits https://github.com/lightningnetwork/lightning-rfc/pull/666
- feature bit dependencies https://github.com/lightningnetwork/lightning-rfc/pull/719
2020-04-01 21:41:24 +02:00
SomberNight
79d57784c1
lnchannel: add more type hints 2020-03-30 03:49:50 +02:00
SomberNight
8ad6d5ddda
lnchannel: clean-up docstrings a bit
Removed lnd copyright as by now everything covered in this file
has been rewritten.
2020-03-30 02:46:21 +02:00
SomberNight
acb0d7ebac
lnchannel: better checks for "update_add_htlc"
I believe this now implements all the checks listed in BOLT-02 for
update_add_htlc, however, the BOLT is sometimes ambiguous,
and actually the checks listed there IMO are insufficient.
There are still some TODOs, in part because of the above.
2020-03-30 02:46:18 +02:00
SomberNight
90f3b667aa
small clean-up re max CLTV delta for LN 2020-03-30 02:46:14 +02:00
SomberNight
5b7ce98ab2
lnchannel: fix included_htlcs 2020-03-27 19:06:30 +01:00
SomberNight
01207316aa
storage upgrade: move "htlc_minimum_msat" to base channel config 2020-03-26 09:05:04 +01:00
SomberNight
53c6fc8cf1
lnchannel: test for max htlc value (needs to be below protocol maximum) 2020-03-26 09:05:00 +01:00
SomberNight
777e350fae
lnchannel: partly fix available_to_spend
we were looking at inconsistent ctns
and we were looking at the wrong subject's ctx

all the FIXMEs and TODOs here will still warrant some attention.

(note that test_DesyncHTLCs was passing incorrectly:
the "assertRaises" was catching a different exception)
2020-03-26 09:04:55 +01:00
SomberNight
2cc76fbbbd
lnworker: fix type error re pending_payments, and impl malformed htlcs
In old code, in lnpeer.htlc_switch(), "error" in lnworker.pending_payments
had incorrect type.

TODO: we need tests for payment failures...
2020-03-17 20:32:38 +01:00
SomberNight
ea0981ebeb
lnutil.UpdateAddHtlc: use attrs instead of old-style namedtuple 2020-03-17 20:31:11 +01:00
ThomasV
444610452e wallet_db: encapsulate type conversions with attr.s converter 2020-03-17 11:04:49 +01:00
ThomasV
6c2ef176cc kivy: show payment log details 2020-03-10 16:44:23 +01:00
ThomasV
15fb8c0415 allow transition from FORCE_CLOSING to REDEEMED. define REDEEM_AFTER_DOUBLE_SPENT_DELAY 2020-03-06 11:40:08 +01:00
SomberNight
a97e7bae05
ChannelDB: make gossip sync progress updates cheaper
get_num_channels_partitioned_by_policy_count() was too slow
2020-03-02 16:56:15 +01:00
SomberNight
6161853941
lnpeer: reduce log spam due to incompatible feature bits 2020-02-26 21:10:33 +01:00
ThomasV
6e5abc049b follow-up previous commit (backward compatibility) 2020-02-21 15:33:15 +01:00
ThomasV
55e0e1a72e Generate channel keys from random seed 2020-02-21 12:38:12 +01:00
ThomasV
86d1e50469 select peers with desired features before connecting 2020-02-21 10:57:13 +01:00
ThomasV
2255b07157 support option_static_remotekey 2020-02-20 21:02:01 +01:00
SomberNight
16626a3386
lnutil.split_host_port: fix for IPv6 connection string 2020-02-17 19:43:21 +01:00
SomberNight
0a5ad9fda4
ecc: small API clean-up 2020-02-11 16:42:02 +01:00
SomberNight
2cf2135528
ecc: abstract away some usage of python-ecdsa: bytes<->int conversions 2020-02-11 16:41:49 +01:00
ThomasV
dbceed2647 Restructure wallet storage:
- Perform json deserializations in wallet_db
 - use StoredDict class that keeps tracks of its modifications
2020-02-04 13:35:58 +01:00
ThomasV
0a9e7cb04e (minor) rename class: StoredAttr -> StoredObject 2020-02-04 13:34:57 +01:00
ThomasV
b08947a506 storage upgrade: convert lists to dict (txi, txo, revocation_store channels) 2020-02-04 12:11:18 +01:00
ThomasV
aa51df0a1a Use attr.s for Feeupdates and Outpoints
Storage upgrade to version 23
2020-02-01 16:45:19 +01:00
ThomasV
757467782a Use attr.s instead of namedtuples for channel config 2020-01-31 12:19:26 +01:00
SomberNight
b99add59c3
lnworker: introduce PaymentAttemptLog NamedTuple 2019-12-10 03:17:57 +01:00
SomberNight
adaa016e78
LNPeerAddr: fix equality tests and hence lnworker._last_tried_peer
follow-up 13d6997355
2019-11-29 00:53:18 +01:00
SomberNight
13d6997355
LNPeerAddr: validate arguments
no longer subclassing NamedTuple (as it is difficult to do validation then...)
2019-11-26 00:15:33 +01:00
SomberNight
edba59ef54
LNPeerAddr: nicer str formatting for IPv6 hosts 2019-11-25 21:10:53 +01:00
SomberNight
cd9477c0da
ln: qt channel open: fix max channel size 2019-11-20 17:45:28 +01:00
ThomasV
47e0b4cd02 fix #5765 2019-11-18 05:12:13 +01:00
ThomasV
78813dcb7d Pass make_tx function to ConfirmTxDialog
- allow 'spend max' when opening a channel (fixes #5698)
 - display amount minus fee when 'max' buttons are pressed
 - estimate fee of channel funding using a template with dummy address
2019-11-14 10:20:19 +01:00
SomberNight
7b18c91b74
psbt follow-up: fix ln cooperative close, and minor type clean up 2019-11-07 18:28:27 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
befa8ea771
transaction: kill "name", "csv_delay", "cltv_expiry" fields 2019-09-09 19:38:35 +02:00
SomberNight
83fcdbd561
lnchannel: handle htlc-address collisions
We were previously generating an incorrect commitment_signed msg if there were
multiple htlcs sharing the same scriptPubKey.
2019-09-07 08:54:41 +02:00