Commit graph

70 commits

Author SHA1 Message Date
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
ccccaf099f
(trivial) logging "verbosity_filter" was renamed to "LOGGING_SHORTCUT" 2019-10-30 03:24:26 +01:00
SomberNight
75902f8e35
fix logic error in lnworker.on_channel_closed 2019-10-29 20:39:58 +01:00
ThomasV
215dc96de7 define LNWatcher.do_breach_remedy 2019-09-11 11:58:28 +02:00
SomberNight
befa8ea771
transaction: kill "name", "csv_delay", "cltv_expiry" fields 2019-09-09 19:38:35 +02:00
ThomasV
e5502a58ba uncomment breach_remedy in watchtower 2019-09-09 18:49:14 +02:00
ThomasV
de29fe6930 remove unused import 2019-08-20 09:03:12 +02:00
ThomasV
740381e993 fix: remove unused parameter to add_sweep_tx 2019-08-20 09:03:12 +02:00
ThomasV
f7c05f2602 Synchronize watchtower asynchronously:
- remove remote_commitment_to_be_revoked
- pass old ctns to lnsweep.create_sweeptxs_for_watchtower
- store the ctn of sweeptxs in sweepStore database
- request the highest ctn from sweepstore using get_ctn
- send sweeptxs asynchronously in LNWallet.sync_with_watchtower
2019-08-20 09:03:12 +02:00
ThomasV
2be68ac4d2 Use one LNWatcher instance per wallet 2019-08-20 09:03:12 +02:00
ThomasV
c7b9bdc5f5 lnwatcher: wait until lnwatcher is fully synchronized before check_onchain_situation 2019-08-20 09:03:12 +02:00
ThomasV
a8ce8109be Perform breach remedy without sweepstore:
- add functions to lnsweep
 - lnworker: analyze candidate ctx and htlc_tx
 - watchtower will be optional
 - add test for breach remedy with spent htlcs
 - save tx name as label
2019-08-20 09:03:12 +02:00
ThomasV
238f3c949c get rid of sql_alchemy 2019-08-20 09:03:12 +02:00
ThomasV
f2d58d0e3f optimize channel_db:
- use python objects mirrored by sql database
 - write sql to file asynchronously
 - the sql decorator is awaited in sweepstore, not in channel_db
2019-08-20 09:03:12 +02:00
ThomasV
7be4cdaf18 redeem htlcs:
- fix bug in lnsweep: lnwatcher transactions were indexed by prev_txid
 - add test for breach remedy with unsettled htlcs
 - add timeout option to lnpay, and replace DO_NOT_SETTLE with SETTLE_DELAY
   so that we can read intermediate commitment tx in regtest
2019-08-20 09:03:11 +02:00
SomberNight
930d21c31c channel close handling: detect situation based on output addresses
WIP...
2019-08-20 09:03:11 +02:00
ThomasV
32e517f407 improve lightning_dialog GUI settings 2019-08-20 09:03:11 +02:00
SomberNight
cc57da704b logging: adapt lightning branch to logging changes 2019-08-20 09:03:11 +02:00
ThomasV
e2182f5846 lnwatcher fixes 2019-08-20 09:03:11 +02:00
ThomasV
3abe30e9d8 basic watchtower synchronization 2019-08-20 09:03:11 +02:00
ThomasV
38f1436d78 post rebase fixes 2019-08-20 09:03:11 +02:00
ThomasV
02d013421a lnwatcher: store transactions as binary 2019-08-20 09:03:11 +02:00
ThomasV
d8e9a9a49e create parent class for sql databases 2019-08-20 09:03:11 +02:00
ThomasV
b861e2e955 lnwatcher: save sweepstore in sqlite database 2019-08-20 09:03:11 +02:00
ThomasV
43d9e0460e follow-up previous commit 2019-08-20 09:03:11 +02:00
ThomasV
8aa4ce0704 improve watchtower gui 2019-08-20 09:03:11 +02:00
ThomasV
f04e10f61a save channel timestamps, and show lightning payments in history tab 2019-08-20 09:03:11 +02:00
ThomasV
19e60f00bb add watchtower_window 2019-08-20 09:03:11 +02:00
Janus
38396e8ed4 lnwatcher: fix incorrect tuple unpacking in do_breach_remedy 2019-08-20 09:03:11 +02:00
ThomasV
b0f39718bb remove useless returns and cryptic names 2019-08-20 09:03:11 +02:00
Janus
2c1fcb2f54 ln: remove EncumberedTransaction 2019-08-20 09:03:11 +02:00
ThomasV
729ddb8ec3 LNWatcher refactoring:
- do not store non-breach transactions
 - send 'channel_open' and 'channel_closed' events
 - force-closed channels are handled by LNWorker
2019-08-20 09:03:11 +02:00
ThomasV
0e3270a1d6 further simplify lnwatcher 2019-08-20 09:03:11 +02:00
SomberNight
595cfcbb65 move sweeping methods from lnchan.py to new file
also sweep "received" htlcs from "our" ctx
also sweep htlcs from their ctx (non-breach)
extract ctn; included_htlcs_in_their_latest_ctxs
2019-08-20 09:03:11 +02:00
ThomasV
88c6eeb966 make LNWatcher inherit AddressSynchronizer 2019-08-20 09:03:11 +02:00
Janus
6211e656a8 lnwatcher: do not get_transaction before broadcast
this workaround was inserted to avoid losing the interface
when rebroadcasting a transaction already in the mempool
many times. but since the network should make sure we always
have a interface ready, and this problem shouldn't happen on
mainnet, remove the workaround
2019-08-20 09:03:11 +02:00
Janus
c8dcf0b471 lnwatcher: more detailed logging, support notifying test suite of txs 2019-08-20 09:03:11 +02:00
Janus
795ba1f99d lnwatcher: ensure probable spendability of prev_tx
previously, we would try to publish the second_stage
even if we couldn't, because a conflicting transaction
was published (like an htlc success when we close with
htlcs pending with a 1-hop payment and an online
counterparty)
2019-08-20 09:03:11 +02:00
Janus
f9f1805cdf use IntEnum for TxMinedDepth 2019-08-20 09:03:11 +02:00
ThomasV
632f11d5da watchtower: add watch_channel rpc 2019-08-20 09:03:11 +02:00
SomberNight
c0ae7b5534 after rebase clean-up 2019-08-20 09:03:10 +02:00
SomberNight
449ec013fe add licence headers to more files 2019-08-20 09:03:10 +02:00
Janus
d6f62d4e7f follow-up redeeming of local outgoing htlc outputs, fix tests 2019-08-20 09:03:10 +02:00
Janus
1f97a9753e redeem htlc outputs of our local commitment transaction back to wallet 2019-08-20 09:03:10 +02:00
SomberNight
f70e679aba some more type annotations that needed conditional imports 2019-08-20 09:03:10 +02:00
ThomasV
87fb0da5e1 minor fix 2019-08-20 09:03:10 +02:00
ThomasV
9362130fba fix race between network and lnwatcher (network.add_job does not always work) 2019-08-20 09:03:10 +02:00
ThomasV
e761f5b876 add watchtower class, send encumbered tx as json 2019-08-20 09:03:10 +02:00
SomberNight
48252318b8 rebase follow-up 2019-08-20 09:03:10 +02:00
ThomasV
30753ed475 watchtower: use network job, catch exceptions 2019-08-20 09:03:10 +02:00