SomberNight
ce81957d25
blockchain: move init_headers_file from network.py to blockchain.py
...
and don't run it every time the network restarts
6 years ago
SomberNight
b21bcf5977
taskgroups: don't log CancelledError
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
ThomasV
e159b1d468
test_close: add unsettled htlc (fails with the current code)
6 years ago
SomberNight
c744fc4e3d
follow-up prev: do all checks, and add tests
6 years ago
SomberNight
a987a2bbbe
keystore: make add_key_origin "API-user-friendly"
...
Power-users that know what they are doing can use this method
to populate key origin information for keystore (bip32 root fingerprint
and derivation path prefix).
Try to make method hard to misuse.
Qt console can now be used as e.g.:
```
wallet.get_keystores()[2].add_key_origin(derivation_prefix="m/48h/1h/0h/2h", root_fingerprint="deadbeef")
```
related #5715
related #5955
related #5969
6 years ago
SomberNight
bea038ea6b
Qt tx dialog: warn if user asked for full bip32 paths but info missing
...
related: https://github.com/spesmilo/electrum/issues/5969#issuecomment-591441399
Instead of a log line, maybe it should warn as part of the GUI.. but this is a start.
6 years ago
SomberNight
22861b70ee
Qt tx dialog: make "export with xpubs" option always available
...
not just if one of the keystores is a coldcard
related: https://github.com/spesmilo/electrum/issues/5969#issuecomment-591441399
6 years ago
SomberNight
6703521f56
rm more cruft from test_lnchannel
...
follow-up e54c69b861
6 years ago
SomberNight
6161853941
lnpeer: reduce log spam due to incompatible feature bits
6 years ago
SomberNight
e54c69b861
add lnchannel.can_send_ctx_updates. just drop illegal updates for now
6 years ago
SomberNight
9d1fa4cc99
(trivial) lnworker: move LNGossip.peer_closed to parent class
6 years ago
ThomasV
3d0c1dbd5c
restore log lines for send_commitment, on_commitment_signed
6 years ago
ThomasV
87fe2c7d7a
define channel.has_pending_changes method
6 years ago
ThomasV
1c5dc79298
shutdown:
...
- resend shutdown on reestablish
- wait until no more pending updates before sending shutdown
6 years ago
ThomasV
9b97469598
(minor) follow-up previous commit
6 years ago
ThomasV
6833adf8b6
simplify previous commit (revert changes on transaction.py)
6 years ago
ThomasV
e85fb25146
lnpeer: verify signature in closing_signed
6 years ago
ThomasV
0848aa259d
(minor) simplification
6 years ago
ThomasV
d5c03307c3
the funder sends the first 'closing_signed' message
6 years ago
SomberNight
9ab18ea6c9
transaction.deserialize: more sanity checks
...
this is mandated by consensus
99813a9745/src/consensus/tx_check.cpp (L13)
6 years ago
ghost43
28572197fb
Merge pull request #5992 from zebra-lucky/fix_spv_hash_merkle_root
...
fix SPV.hash_merkle_root, add tests/test_verifier.py
6 years ago
SomberNight
4f5f949979
follow-up prev
...
Clean up tests a bit, and rm some of them.
It's overkill to test with SPV._raise_if_valid_tx mocked out.
6 years ago
SomberNight
e9251c8e59
lnpeer: add "DO NOT TRUST..." remark to errors sent by remote
...
potential phishing...
6 years ago
SomberNight
6937b87a7c
transaction.BCDataStream: minor fixes
...
- fix read/write_boolean (though unused...)
- sanity check in read_bytes
6 years ago
zebra-lucky
c0be0471f2
fix BCDataStream.read_bytes ( #5991 )
...
* fix BCDataStream.read_bytes
* followup fix BCDataStream.read_bytes: fix TestBCDataStream.test_bytes
6 years ago
zebra-lucky
d4f7c207a7
fix SPV.hash_merkle_root, add tests/test_verifier.py
6 years ago
SomberNight
aaf174ef3e
lnpeer: cooperative close: verify scriptpubkey matches templates
6 years ago
Jakub Łukasiewicz
c121230706
Added ELECTRUMDIR env variable ( #5543 )
...
Simple way for allowing users to change localization of Electrum directory
from ~/.electrum to somewhere else
6 years ago
ThomasV
2927478192
lnpeer: closing fee negociation:
...
- use fee_rate from config
- set upper bound on fee
- add test_close to test_lnpeer
6 years ago
SomberNight
e7ab9e4054
lnpeer: await_remote/await_local now more restrictive, and docstring
...
Previously it was not so clear what these methods were doing.
6 years ago
SomberNight
5fda2cbb42
fix test: test_reestablish_with_old_state
...
Messages sent as part of the payment were getting interleaved with the channel_reestablish.
It does not actually make sense to do a payment and then reestablish the channel in the same transport -- the channel is supposed to already have been reestablished to do a payment in the first place.
So, after payment, strip down the transport, and set up a new transport before reestablishing.
Traceback (most recent call last):
File "...\Python\Python38\lib\unittest\case.py", line 60, in testPartExecutor
yield
File "...\Python\Python38\lib\unittest\case.py", line 676, in run
self._callTestMethod(testMethod)
File "...\Python\Python38\lib\unittest\case.py", line 633, in _callTestMethod
method()
File "...\electrum\electrum\tests\test_lnpeer.py", line 262, in test_reestablish_with_old_state
run(f())
File "...\electrum\electrum\tests\test_lnpeer.py", line 302, in run
return asyncio.run_coroutine_threadsafe(coro, loop=asyncio.get_event_loop()).result()
File "...\Python\Python38\lib\concurrent\futures\_base.py", line 439, in result
return self.__get_result()
File "...\Python\Python38\lib\concurrent\futures\_base.py", line 388, in __get_result
raise self._exception
File "...\electrum\electrum\tests\test_lnpeer.py", line 260, in f
await gath
File "...\electrum\electrum\lnpeer.py", line 439, in _message_loop
self.process_message(msg)
File "...\electrum\electrum\lnpeer.py", line 159, in process_message
execution_result = f(payload)
File "...\electrum\electrum\lnpeer.py", line 1308, in on_revoke_and_ack
chan.receive_revocation(rev)
File "...\electrum\electrum\lnchannel.py", line 556, in receive_revocation
raise Exception('revoked secret not for current point')
Exception: revoked secret not for current point
6 years ago
SomberNight
4a8ee1818a
follow-up prev
...
E/W | lnwatcher.LNWalletWatcher | Exception in on_network_update: AssertionError('None')
Traceback (most recent call last):
File "...\electrum\electrum\util.py", line 1035, in wrapper
return await func(*args, **kwargs)
File "...\electrum\electrum\lnwatcher.py", line 174, in on_network_update
await self.check_onchain_situation(address, outpoint)
File "...\electrum\electrum\lnwatcher.py", line 184, in check_onchain_situation
closing_height = self.get_tx_height(closing_txid)
File "...\electrum\electrum\address_synchronizer.py", line 597, in get_tx_height
verified_tx_mined_info = self.db.get_verified_tx(tx_hash)
File "...\electrum\electrum\json_db.py", line 44, in wrapper
return func(self, *args, **kwargs)
File "...\electrum\electrum\wallet_db.py", line 859, in get_verified_tx
assert isinstance(txid, str), f"{repr(txid)}"
AssertionError: None
6 years ago
SomberNight
88658f9c2c
WalletDB: add type hints, and also corresponding asserts for sanity
6 years ago
SomberNight
931d961721
lnpeer/lnwatcher: include channel id in log lines
6 years ago
SomberNight
3966b51a94
fix undefined name 'CHANNEL_INIT_TIMEOUT'
6 years ago
SomberNight
a78583e5d4
travis: fix regtest
6 years ago
ThomasV
8ff1921c0d
(minor) fix log
6 years ago
ThomasV
7908f4b203
follow-up previous commit
6 years ago
ThomasV
5785c2fa2f
Fix #5975 : Forget or redeem channels that are never funded.
...
- initiator: wait until double spent
- non-initiator: wait until timeout
6 years ago
ThomasV
ed29a45d50
Qt: disable preview button in open_channel
6 years ago
ThomasV
20d8da7e24
db upgrade: store channel tx height and timestamps in 'channels'
6 years ago
ThomasV
e8ee4250d9
Do not save new channels before they are added to lnworker
6 years ago