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.
6 years ago
ThomasV
8f41aeb783
Replace wallet backup with channel backups
...
- channels can be backed up individually
- backups are added to lnwatcher
- AbstractChannel ancestor class
6 years ago
ThomasV
d2a58a2ec3
lnpeer: do not assume our privkey is the same as lnworker's privkey.
6 years ago
ThomasV
f3995350e8
localconfig: rename seed to channel_seed
6 years ago
ThomasV
0ea21c59d2
Save channel seed in localconfig
6 years ago
SomberNight
1be0a710c3
ln: implement option payment_secret
6 years ago
SomberNight
d424487814
lnpeer: better error handling when processing onion packets
6 years ago
SomberNight
30bf32b34b
use option varonion: actually use TLV payloads, and signal support
6 years ago
SomberNight
a66437f399
lnonion: implement basis of varonion support
6 years ago
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
6 years ago
SomberNight
71a4302ec0
lnpeer: send and handle "networks" param in "init" msg
6 years ago
SomberNight
3a73f6ee5c
lnmsg.decode_msg: dict values for numbers are int, instead of BE bytes
...
Will be useful for TLVs where it makes sense to do the conversion in lnmsg,
as it might be more complicated than just int.from_bytes().
6 years ago
SomberNight
4c10a830f3
lnmsg: rewrite LN msg encoding/decoding
6 years ago
SomberNight
db84de5493
trivial: use "chunks()" for htlc_sigs in lnchannel
6 years ago
SomberNight
90f3b667aa
small clean-up re max CLTV delta for LN
6 years ago
SomberNight
01207316aa
storage upgrade: move "htlc_minimum_msat" to base channel config
6 years ago
SomberNight
cf5872d2c1
follow-up prev
6 years ago
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...
6 years ago
SomberNight
b524460fdf
lnpeer: implement basic handling of "update_fail_malformed_htlc"
6 years ago
ThomasV
ffa3760a17
follow-up prev: rm decorator, preprocess channel_id for all messages
6 years ago
ThomasV
386d385389
lnpeer: channel_update decorator
6 years ago
ThomasV
2c617c3b00
move feerate warning to lnpeer
6 years ago
ThomasV
888a6d726e
Propagate exceptions raise by force_close to the GUI.
...
Define 'try_force_closing' for cases where we do not
want exceptions to be raised.
6 years ago
ThomasV
28452e2d46
do not try to reestablish channel if state is FORCE_CLOSING
6 years ago
SomberNight
fa0ef9c548
ln: store network addresses for channel counterparties in channels
...
So we can reconnect to them without relying on gossip db.
6 years ago
ThomasV
8f3fcdd1a8
Fix detection of payments.
...
1. In lnhtlc, sent_in_ctn and failed_in_ctn need to look at the
remote ctx, and they need to be called when we receive a revocation,
not when we send one.
2. In lnchannel, we use 3 lnworker callbacks:
- payment sent/payment failed (called when we receive a revocation)
- payment received (called when we send a revocation)
3. Make revoke_current_commitment return a single value.
The second value was only used in tests, there is no need
to bloat the code with that
6 years ago
ThomasV
b9eaba3e85
replace await_local/remote
6 years ago
ThomasV
4c177c4c92
less verbose update_fee log
6 years ago
ThomasV
79497cd3ec
(minor) rm unneeded decorator
6 years ago
ThomasV
97d191a121
maybe_forward_htlc: catch exceptions raised by nexp_peer. return only error
6 years ago
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
6f2cd8b4f5
Qt tx dialog: allow setting custom locktime
...
closes #2405
closes #1685
6 years ago
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
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
ThomasV
15e91169c5
lnpeer: fix json serialization of funding_inputs
6 years ago
ThomasV
8f6fc5917a
make sure we can send shutdown
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
0bf09d14a0
fix regression in shutdown (from 1c5dc79298)
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
ThomasV
d04b8c05e2
(minor) fix typo in comment
6 years ago
ThomasV
f5053cc242
follow-up e54c69b861c2990adf9cf618b68c6f1c7dd3ebea: we must settle HTCLs after during shutdown
6 years ago
SomberNight
6161853941
lnpeer: reduce log spam due to incompatible feature bits
6 years ago