ThomasV
cfc20845a2
lnworker: dissociate htlc forwarding and fulfillment
2020-03-02 11:54:08 +01:00
ThomasV
09675bd911
make maybe_fulfill_htlc, maybe_forward_htlc synchronous.
...
move async operations to lnworker.htlc_switch
2020-03-02 11:19:04 +01:00
ThomasV
d827aedd16
lnpeer: do not drop channel updates if cannot send
2020-03-02 11:19:04 +01:00
ThomasV
da67fda92a
HTLC switch:
...
- fulfills/fails/forwards HTLCs
- onion_packets are saved when update_add_htlc is received
2020-03-02 11:19:04 +01:00
SomberNight
6f2cd8b4f5
Qt tx dialog: allow setting custom locktime
...
closes #2405
closes #1685
2020-03-01 09:14:50 +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
a32af44ff9
trivial clean-up (typing/imports)
2020-02-28 20:27:35 +01:00
ThomasV
077f778632
Replace lightning_settle_delay with enable_htlc_settle (asyncio.Event)
2020-02-28 10:15:28 +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
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
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
SomberNight
e9251c8e59
lnpeer: add "DO NOT TRUST..." remark to errors sent by remote
...
potential phishing...
2020-02-25 20:09:33 +01:00
SomberNight
aaf174ef3e
lnpeer: cooperative close: verify scriptpubkey matches templates
2020-02-25 17:54:49 +01:00
ThomasV
2927478192
lnpeer: closing fee negociation:
...
- use fee_rate from config
- set upper bound on fee
- add test_close to test_lnpeer
2020-02-25 15:23:15 +01:00
SomberNight
e7ab9e4054
lnpeer: await_remote/await_local now more restrictive, and docstring
...
Previously it was not so clear what these methods were doing.
2020-02-24 21:23:13 +01:00
SomberNight
931d961721
lnpeer/lnwatcher: include channel id in log lines
2020-02-24 16:32:18 +01:00
ThomasV
5785c2fa2f
Fix #5975 : Forget or redeem channels that are never funded.
...
- initiator: wait until double spent
- non-initiator: wait until timeout
2020-02-24 12:45:10 +01:00
ThomasV
e8ee4250d9
Do not save new channels before they are added to lnworker
2020-02-24 09:44:35 +01:00
ThomasV
ac884eb3c3
lnpeer: Use a single queue per channel for messages that are ordered.
...
Forward error messages with 'temporary_channel_id' to the correct channel_id
2020-02-23 18:06:47 +01:00
ThomasV
28c5825f41
follow-up previous commit
2020-02-23 17:56:01 +01:00
ThomasV
54ef6db762
do not try to reestablish channels in PREOPENING state (per BOLT2).
2020-02-23 14:54:04 +01:00
ThomasV
d319680d16
lnpeer: do not dump exceptions raised in initialize
2020-02-22 16:00:38 +01:00
ThomasV
bda23ef73d
Use a Future for lnpeer.initialized, so that exceptions are passed to the GUI
2020-02-22 09:04:24 +01:00
ThomasV
a1b8c8e54e
add comment about minor issue with closing_signed
2020-02-21 18:30:59 +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
a96aa68a4c
lnpeer:
...
- print parent classname in diagnostic name,
- fix error message when requested feature is not supported
2020-02-21 09:48:36 +01:00
ThomasV
570167a2c4
restrict lightning to p2wpkh wallets
2020-02-20 21:17:25 +01:00
ThomasV
2255b07157
support option_static_remotekey
2020-02-20 21:02:01 +01:00
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.
2020-02-17 20:38:41 +01:00
ThomasV
2f10bc2f4d
reestablish: force_close if we are a recent backup
2020-02-15 16:28:15 +01:00
ThomasV
bb21e01823
(minor) call lnwatcher.add_channel from lnworker.add_channel
2020-02-14 14:15:15 +01:00
ThomasV
e3630d87b2
test_lnpeer: test_reestablish_with_old_state
2020-02-12 10:22:22 +01:00
ThomasV
3377627070
reestablish_channel: shorter varnames
2020-02-12 06:18:22 +01:00