SomberNight
22a8348303
renames: use consistent naming of cltv delta vs cltv abs
...
to avoid confusing relative vs absolute cltvs
(see b0401a6386 )
2 years ago
ThomasV
68159b3ef6
walletDB: replace 'manual_upgrades' parameter with 'upgrade', with opposite semantics
2 years ago
ThomasV
b5bc5ff9ed
Separate WalletDB from storage upgrades.
...
Make sure that WalletDB.data is always a StoredDict.
Perform db upgrades in a separate class, since they
operate on a dict object.
2 years ago
ThomasV
b96cc82333
Make storage a field of db
...
This comes from the jsonpatch_new branch.
I rather have in master now, because it touches a lot of filese.
2 years ago
SomberNight
a6c36b8588
regtests: test_watchtower started failing due to newly exposed bug
...
local_watchtower.adb.start_network was getting called twice.
follow-up 6ac3f84095
```
20230418T014725.636141Z | ERROR | __main__ |
Traceback (most recent call last):
File "/home/user/wspace/electrum/./run_electrum", line 435, in main
handle_cmd(
File "/home/user/wspace/electrum/./run_electrum", line 469, in handle_cmd
d = daemon.Daemon(config, fd)
File "/home/user/wspace/electrum/electrum/util.py", line 462, in <lambda>
return lambda *args, **kw_args: do_profile(args, kw_args)
File "/home/user/wspace/electrum/electrum/util.py", line 458, in do_profile
o = func(*args, **kw_args)
File "/home/user/wspace/electrum/electrum/daemon.py", line 404, in __init__
self.network = Network(config, daemon=self)
File "/home/user/wspace/electrum/electrum/network.py", line 348, in __init__
self.local_watchtower.adb.start_network(self)
File "/home/user/wspace/electrum/electrum/address_synchronizer.py", line 185, in start_network
assert self.network is None, "already started"
AssertionError: already started
```
3 years ago
SomberNight
446879ade0
lnwatcher.maybe_redeem: wanted_height should always be absolute
...
previously, if prev_height.height was <= 0, lnwatcher was calling adb.set_future_tx()
with weird wanted_height values (with ~sweep_info.csv_delay)
3 years ago
SomberNight
1530668960
qt/qml: delay starting network until after first-start-network-setup
...
The qt, qml, and kivy GUIs have a first-start network-setup screen
that allows the user customising the network settings before creating a wallet.
Previously the daemon used to create the network and start it, before this screen,
before the GUI even starts. If the user changed network settings, those would
be set on the already running network, potentially including restarting the network.
Now it becomes the responsibility of the GUI to start the network, allowing this
first-start customisation to take place before starting the network at all.
The qt and the qml GUIs are adapted to make use of this. Kivy, and the other
prototype GUIs are not adapted and just start the network right away, as before.
3 years ago
SomberNight
62ab6d9702
(trivial) reduce log spam during ln-channel-open
3 years ago
SomberNight
373db76ac9
util: kill bh2u
...
no longer useful, and the name is so confusing...
3 years ago
ThomasV
abaa42eac0
make lnwatcher less spammy
3 years ago
SomberNight
757ec53ea2
AddressSynchronizer: set diagnostic_name for better logs
...
fixes regression from 121d8732f1
in particular, this is needed for Synchronizer.diagnostic_name and SPV.diagnostic_name
3 years ago
ThomasV
60c493dc15
adb: trigger adb_added_tx event only if the transaction is new
3 years ago
ThomasV
fceceaec97
lnwatcher: set future_tx regardless of tx_was_added, because it is not persisted
3 years ago
ThomasV
9058000791
lnwatcher: fix adding of local tx to history
3 years ago
ThomasV
a5965933d2
Fix CTNs in should_be_closed_due_to_expiring_htlcs ( fixes #7906 ).
...
Also fix sending too many fee updates.
Rename lnworker.on_channel_update, that name was misleading.
3 years ago
ThomasV
cace1b5013
lnwatcher: compare txids instead of tx objects, before calling add_transaction or set_label
3 years ago
ThomasV
4a27e4e51a
fix #7895 : rename parameter
3 years ago
ThomasV
02e4569086
auto-remove redeemed channel backups. fix indentation.
3 years ago
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==
```
4 years ago
ThomasV
dbf055de9a
EventListener class to handle callbacks
...
and QtEventListener for Qt
4 years ago
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
4 years ago
ThomasV
6e7ffa29ae
Move address_is_old to AddressSynchronizer.
...
Cache local_height at that level instead of wallet.synchronize
4 years ago
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
4 years ago
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
4 years ago
ThomasV
672326bd12
lnwatcher: a bit less verbose
4 years ago
ThomasV
56659c550e
lnwatcher: fix another broadcast-too-early error
4 years ago
ThomasV
e99a5a7703
fix lnwatcher broadcast logic, follow-up b9f01a86fe
4 years ago
ThomasV
b9f01a86fe
lnwatcher: check that parent transaction is confirmed in CSV test
4 years ago
ThomasV
44f29331bf
lnwatcher: in inspect_tx_candidate, match witness scripts against HTLC templates
...
fixes #7781
4 years ago
bitromortac
ff61020dd2
watchtower: watch new channels
4 years ago
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.
5 years ago
ThomasV
aa1fcc784e
wallet: store wanted_height in future_tx, instead of remaining blocks
5 years ago
ThomasV
bbb9ce2430
lnwatcher.try_redeem: output log only the first time a tx is seen
5 years ago
ThomasV
aba0bad30c
lnwatcher: try_redeem must return if tx is None
5 years ago
ThomasV
cd025c5553
inspect_tx_candidate: tx output must be of address type
5 years ago
SomberNight
3c019c2f9c
daemon/wallet/network: make stop() methods async
5 years ago
SomberNight
9380b331e4
LNWatcher: implement diagnostic_name; for nicer log lines
5 years ago
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.
6 years ago
ThomasV
782f9ed273
lnwatcher: use generic callbacks
6 years ago
SomberNight
62be1cc367
small clean-up re "extract preimage from on-chain htlc_tx"
...
related: #6122
6 years ago
ThomasV
8ba7e68064
fix #6122 : extract preimage from on-chain htlc_tx
6 years ago
ThomasV
123b8c1792
(minor) rename chan.sweep_htlc
6 years ago
SomberNight
2b1a150c52
multi-wallet: properly stop lnworker/lnwatcher
6 years ago
ThomasV
bdb870af00
follow-up c454564ed6
6 years ago
ThomasV
9224404108
Move callback manager out of Network class
6 years ago
SomberNight
8e8ab775eb
lnchannel: make AbstractChannel inherit ABC
...
and add some type annotations, clean up method signatures
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
aa32e31a3d
follow-up previous commit
6 years ago
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()
6 years ago
SomberNight
79d57784c1
lnchannel: add more type hints
6 years ago