SomberNight
b6b7b0a6c0
lnwatcher.inspect_tx_candidate: handle witness being None
...
```
E/W | lnwatcher.LNWalletWatcher.[test_segwit_2-LNW] | Exception in trigger_callbacks: AssertionError('witness is missing! txid=49f0fe532c07ec099ea3a9540a06141f529d28244c3a7be20f54843636cd7380. rawtx=cHNidP8BAFICAAAAAbliIHcoL1ZXwvRfBrjmhEJ63isM+wBBiCoZW231T2jhAAAAAAD9////AbMsQQAAAAAAFgAURC0BRfNFWqqD+jbsTaiX0/qjrE2v2iIAAAEA/S8BAgAAAAABAVbd14mCS0q4HjYGhWppSXvBvx9POsTYDSwXAIkxJF1iAAAAAAD/////ASEtQQAAAAAAFgAUh+Ku4dqhbNrjKjcK65dsZAWV+ocEAEcwRAIgcILGbxQK7wxiq1yBY6GxGBs4A32pBzC4PUSiMY0QuVMCIGtWnoRD/2zx4BshRYeHsg7wp9ClplQWxjsBJszXEcPfAUgwRQIhAPn0dsBeyqW4U0TbOgJMMEEuKwqBXfXHryHJvOxcwKafAiBRBBFpJvYxMtjkg7aABj1yUEwBaZuAqg1a8mlbHLKnBwFHUiECRc2elI2LEqEE31/G9tC6IA4yV09nKK6nSTez2vUlVikhAxbmJytLCOgHfz1vFqKrZMhERzVCJd0AaAkBWZqMKbe6Uq4AAAAAIgYDtG0jdrMO8FbxdAepULYg1Hu8fbq6hQ7Ki35K6/TViEQQ0uN52gAAAIABAAAAgQAAAAAiAgIP7MeuyqhS6fOpbLYY/1R+Rgmc0sYyA5GHEXBYOpWSoBDS43naAAAAgAAAAAB7AAAAAA==')
Traceback (most recent call last):
File "...\electrum\electrum\util.py", line 1176, in wrapper
return await func(*args, **kwargs)
File "...\electrum\electrum\lnwatcher.py", line 213, in trigger_callbacks
await callback()
File "...\electrum\electrum\lnwatcher.py", line 219, in check_onchain_situation
spenders = self.inspect_tx_candidate(funding_outpoint, 0)
File "...\electrum\electrum\lnwatcher.py", line 297, in inspect_tx_candidate
r = self.inspect_tx_candidate(spender_txid+':%d'%i, n+1)
File "...\electrum\electrum\lnwatcher.py", line 281, in inspect_tx_candidate
assert witness, f"witness is missing! txid={spender_txid}. rawtx={str(spender_tx)}"
AssertionError: witness is missing! txid=49f0fe532c07ec099ea3a9540a06141f529d28244c3a7be20f54843636cd7380. rawtx=cHNidP8BAFICAAAAAbliIHcoL1ZXwvRfBrjmhEJ63isM+wBBiCoZW231T2jhAAAAAAD9////AbMsQQAAAAAAFgAURC0BRfNFWqqD+jbsTaiX0/qjrE2v2iIAAAEA/S8BAgAAAAABAVbd14mCS0q4HjYGhWppSXvBvx9POsTYDSwXAIkxJF1iAAAAAAD/////ASEtQQAAAAAAFgAUh+Ku4dqhbNrjKjcK65dsZAWV+ocEAEcwRAIgcILGbxQK7wxiq1yBY6GxGBs4A32pBzC4PUSiMY0QuVMCIGtWnoRD/2zx4BshRYeHsg7wp9ClplQWxjsBJszXEcPfAUgwRQIhAPn0dsBeyqW4U0TbOgJMMEEuKwqBXfXHryHJvOxcwKafAiBRBBFpJvYxMtjkg7aABj1yUEwBaZuAqg1a8mlbHLKnBwFHUiECRc2elI2LEqEE31/G9tC6IA4yV09nKK6nSTez2vUlVikhAxbmJytLCOgHfz1vFqKrZMhERzVCJd0AaAkBWZqMKbe6Uq4AAAAAIgYDtG0jdrMO8FbxdAepULYg1Hu8fbq6hQ7Ki35K6/TViEQQ0uN52gAAAIABAAAAgQAAAAAiAgIP7MeuyqhS6fOpbLYY/1R+Rgmc0sYyA5GHEXBYOpWSoBDS43naAAAAgAAAAAB7AAAAAA==
```
2022-07-05 14:53:33 +02:00
ThomasV
dbf055de9a
EventListener class to handle callbacks
...
and QtEventListener for Qt
2022-06-22 02:07:46 +02:00
ThomasV
7d5125c935
lnwatcher: fix tx replacement and notifications
...
- revert the logic of do_breach_remedy to what it was
before 0ca3d66d15 ,
but now calling self.maybe_redeem unconditionally.
- replace mempool transactions only if the fee increases
- do not notify the GUI if a local tx is replaced
- delete labels when replacing
2022-06-12 14:28:11 +02:00
ThomasV
6e7ffa29ae
Move address_is_old to AddressSynchronizer.
...
Cache local_height at that level instead of wallet.synchronize
2022-06-10 13:07:53 +02:00
ThomasV
0ca3d66d15
persist_lnwatcher: split try_redeem into two methods:
...
- maybe_add_redeem_tx
- maybe_broadcast
Before this commit, local tx that are now persisted
are bot broadcast
2022-06-10 13:07:53 +02:00
ThomasV
121d8732f1
Persist LNWatcher transactions in wallet file:
...
- separate AddressSynchronizer from Wallet and LNWatcher
- the AddressSynchronizer class is referred to as 'adb' (address database)
- Use callbacks to replace overloaded methods
2022-06-10 13:07:53 +02:00
ThomasV
672326bd12
lnwatcher: a bit less verbose
2022-05-26 12:00:11 +02:00
ThomasV
56659c550e
lnwatcher: fix another broadcast-too-early error
2022-05-25 12:45:53 +02:00
ThomasV
e99a5a7703
fix lnwatcher broadcast logic, follow-up b9f01a86fe
2022-05-25 12:34:52 +02:00
ThomasV
b9f01a86fe
lnwatcher: check that parent transaction is confirmed in CSV test
2022-05-24 19:13:10 +02:00
ThomasV
44f29331bf
lnwatcher: in inspect_tx_candidate, match witness scripts against HTLC templates
...
fixes #7781
2022-04-28 13:21:10 +02:00
bitromortac
ff61020dd2
watchtower: watch new channels
2021-09-27 10:31:44 +02:00
ThomasV
763ee86028
lnwatcher: trigger 'verified' callback with the main wallet object.
...
This is a temporary fix; we should not use an extra synchronizer, and persist results.
2021-03-23 11:05:05 +01:00
ThomasV
aa1fcc784e
wallet: store wanted_height in future_tx, instead of remaining blocks
2021-03-22 11:00:42 +01:00
ThomasV
bbb9ce2430
lnwatcher.try_redeem: output log only the first time a tx is seen
2021-03-20 09:30:15 +01:00
ThomasV
aba0bad30c
lnwatcher: try_redeem must return if tx is None
2021-03-20 09:10:48 +01:00
ThomasV
cd025c5553
inspect_tx_candidate: tx output must be of address type
2021-03-17 15:55:53 +01:00
SomberNight
3c019c2f9c
daemon/wallet/network: make stop() methods async
2021-03-09 17:52:36 +01:00
SomberNight
9380b331e4
LNWatcher: implement diagnostic_name; for nicer log lines
2020-09-18 20:54:09 +02:00
SomberNight
2c962abe51
network: randomise the order of address subscriptions
...
Before this, we were subscribing to our addresses in their bip32 order,
leaking this information to servers. While this leak seems mostly harmless,
it is trivial to fix.
2020-06-17 19:25:52 +02:00
ThomasV
782f9ed273
lnwatcher: use generic callbacks
2020-05-20 13:49:44 +02:00
SomberNight
62be1cc367
small clean-up re "extract preimage from on-chain htlc_tx"
...
related: #6122
2020-05-06 03:15:20 +02:00
ThomasV
8ba7e68064
fix #6122 : extract preimage from on-chain htlc_tx
2020-05-03 16:03:27 +02:00
ThomasV
123b8c1792
(minor) rename chan.sweep_htlc
2020-05-02 11:42:47 +02:00
SomberNight
2b1a150c52
multi-wallet: properly stop lnworker/lnwatcher
2020-05-01 04:50:08 +02:00
ThomasV
bdb870af00
follow-up c454564ed6
2020-04-21 15:31:13 +02:00
ThomasV
9224404108
Move callback manager out of Network class
2020-04-14 18:29:51 +02:00
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
aa32e31a3d
follow-up previous commit
2020-04-03 18:54:02 +02:00
ThomasV
06dfe1699c
LNWatcher: Distinguish between blockchain-triggered channel state
...
transitions, and actions taken as a result.
- state transitions are performed in lnchannel.update_onchain_state()
- peer actions are in LNWorker.on_channel_update()
2020-04-03 17:34:11 +02:00
SomberNight
79d57784c1
lnchannel: add more type hints
2020-03-30 03:49:50 +02:00
SomberNight
ec6be665d5
lnwatcher: unwatch deeply mined channels
...
reduces log spam generated by "REDEEMED" channels...
2020-03-14 04:44:01 +01:00
ThomasV
8b63f7176e
Add short channel id to tx labels
2020-03-07 10:53:38 +01:00
ThomasV
3c111471e9
Fix bug with save_funding_height, save_closing_height
...
(it would enter a state where only closing_height was saved)
2020-03-07 10:39:49 +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
20d8da7e24
db upgrade: store channel tx height and timestamps in 'channels'
2020-02-24 10:07:55 +01:00
ThomasV
9616333b39
add_future_tx should return success
2020-02-22 17:20:05 +01:00
ThomasV
874efc125d
(minor) trigger 'wallet_updated' callback when adding future tx
2020-02-22 12:59:48 +01:00
ThomasV
3329d9dd0e
lnwatcher: fix keep_watching if the wallet was not force-closed
2020-02-21 16:35:27 +01:00
ThomasV
fe4ca4c466
follow-up previous commit
2020-02-18 20:06:35 +01:00
ThomasV
c9e39d3a79
remove channel from channel_timestamps if funding_tx has been dropped from mempool
2020-02-18 18:04:23 +01:00
SomberNight
d1fc4399e6
lnwatcher: use is_mine(addr) instead of (addr in get_addresses())
...
small performance gain
2020-02-18 17:16:46 +01:00
ThomasV
72f4e83333
fix race in check_onchain_situation
2020-02-18 17:06:54 +01:00
ThomasV
6e6e829ef7
breach remedy: get spender transaction from LNWatcher's db
2020-02-17 09:19:23 +01:00
ThomasV
938fab86d1
detect redeemed channels ( fix #5963 )
2020-02-16 19:07:20 +01:00
ThomasV
f8da0f87a7
follow-up previous commit
2020-02-16 14:45:04 +01:00
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.
2020-02-16 14:26:18 +01:00
ThomasV
dba6cb8a96
lnwatcher: use height == TX_HEIGHT_LOCAL to determine channel onchain state
2020-02-16 12:57:25 +01:00