ThomasV
f801307a08
move htlc_switch task to lnpeer
6 years ago
ThomasV
5d3bca7bb8
htlc_switch: decouple maybe_send_commitment from htlc processing
6 years ago
ThomasV
cfc20845a2
lnworker: dissociate htlc forwarding and fulfillment
6 years ago
ThomasV
09675bd911
make maybe_fulfill_htlc, maybe_forward_htlc synchronous.
...
move async operations to lnworker.htlc_switch
6 years ago
ThomasV
d827aedd16
lnpeer: do not drop channel updates if cannot send
6 years ago
ThomasV
da67fda92a
HTLC switch:
...
- fulfills/fails/forwards HTLCs
- onion_packets are saved when update_add_htlc is received
6 years ago
SomberNight
c7704fb8ee
lnworker: allow changing labels of chan-open/chan-close txns
6 years ago
SomberNight
67d24bf129
add LN gossip sync progress estimate indicator to Qt GUI
6 years ago
SomberNight
a32af44ff9
trivial clean-up (typing/imports)
6 years ago
ThomasV
077f778632
Replace lightning_settle_delay with enable_htlc_settle (asyncio.Event)
6 years ago
SomberNight
b21bcf5977
taskgroups: don't log CancelledError
6 years ago
SomberNight
ed234d3444
rename all TaskGroup() fields to "taskgroup"
...
for consistency
6 years ago
SomberNight
c8260249b0
lnworker: add own taskgroup (run in daemon.taskgroup)
6 years ago
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.
6 years ago
SomberNight
9d1fa4cc99
(trivial) lnworker: move LNGossip.peer_closed to parent class
6 years ago
ThomasV
1c5dc79298
shutdown:
...
- resend shutdown on reestablish
- wait until no more pending updates before sending shutdown
6 years ago
SomberNight
3966b51a94
fix undefined name 'CHANNEL_INIT_TIMEOUT'
6 years ago
ThomasV
8ff1921c0d
(minor) fix log
6 years ago
ThomasV
5785c2fa2f
Fix #5975 : Forget or redeem channels that are never funded.
...
- initiator: wait until double spent
- non-initiator: wait until timeout
6 years ago
ThomasV
20d8da7e24
db upgrade: store channel tx height and timestamps in 'channels'
6 years ago
ThomasV
e8ee4250d9
Do not save new channels before they are added to lnworker
6 years ago
ThomasV
947211fe4e
follow-up 54ef6db762b5ea120a59af0a2470eac999c55d93: set channel state to OPENING if funding tx was broadcast later (e.g. cold storage)
6 years ago
SomberNight
cc5624fb20
don't raise BaseException
6 years ago
ThomasV
54ef6db762
do not try to reestablish channels in PREOPENING state (per BOLT2).
6 years ago
ThomasV
64a8de8bae
Qt: show amounts sent to channels in show_transaction
6 years ago
ThomasV
fa62d03c2a
require option static_remotekey in lnwallet
6 years ago
ThomasV
bda23ef73d
Use a Future for lnpeer.initialized, so that exceptions are passed to the GUI
6 years ago
ThomasV
1b586faec9
disable peer filtering in lnworker
6 years ago
ThomasV
55e0e1a72e
Generate channel keys from random seed
6 years ago
ThomasV
86d1e50469
select peers with desired features before connecting
6 years ago
ThomasV
2255b07157
support option_static_remotekey
6 years ago
ThomasV
47d14c579b
minor fix: can_send, can_receive
6 years ago
ThomasV
704c3ae07f
do not allow channel creation from backup file
6 years ago
ThomasV
9451ca9568
move list_channels to commands.py
6 years ago
ThomasV
238fb46d87
Lightning: Show sending and receiving capacity. Fixes #5967
6 years ago
ThomasV
feb47b0a6f
Add lightning tx dialog (qt and kivy)
6 years ago
SomberNight
46d8080c76
ln gossip: don't put own channels into db; always pass them to fn calls
...
Previously we would put fake chan announcement and fake outgoing chan upd
for own channels into db (to make path finding work). See Peer.add_own_channel().
Now, instead of above, we pass a "my_channels" param to the relevant ChannelDB methods.
6 years ago
ThomasV
4dc74870e1
Catch exceptions raised in LNWorker._pay_to_route
...
Reset payment status if an exception is caught.
Also, do not pass status to the 'invoice_status' network callback.
This fixes #5869 , #5870 , #5964 .
6 years ago
ThomasV
472c0defee
fix lnchannel.get_payments: unsettled htlcs may have overwritten the returned results.
6 years ago
ThomasV
938fab86d1
detect redeemed channels ( fix #5963 )
6 years ago
ThomasV
f8da0f87a7
follow-up previous commit
6 years ago
ThomasV
3a35f90aa0
Do not use network callback to update channel states; call LNWorker methods directly instead.
...
A callback was used because a single LNWnwatcher object used to be shared for all wallets.
Since wallet now have their own LNWatcher instance, this can be simplified.
6 years ago
ThomasV
36f32651cc
Define network.try_broadcasting() method.
...
Use it when rebroadcasting a force-close tx,
because the channel state is already set.
6 years ago
ThomasV
2dad87cbb4
Automate backups:
...
- backup wallet file on each channel creation
- on android, a backup password is entered in settings
- on desktop, the backup path is in settings
6 years ago
ThomasV
bb21e01823
(minor) call lnwatcher.add_channel from lnworker.add_channel
6 years ago
ThomasV
471fdd1d97
follow-up previous commit
6 years ago
ThomasV
2a7b5081c9
channel states: make sure that closing_txid is saved if channel is closed
6 years ago
SomberNight
0a5ad9fda4
ecc: small API clean-up
6 years ago
ThomasV
e1ce3aace7
Separate db from storage
...
- storage is content-agnostic
- db and storage are passed to wallet contructor
6 years ago
ThomasV
dbceed2647
Restructure wallet storage:
...
- Perform json deserializations in wallet_db
- use StoredDict class that keeps tracks of its modifications
6 years ago