Commit graph

449 commits

Author SHA1 Message Date
ThomasV
f155f3aff5 start lngossip if instantiated; this saves a boolean 2020-10-22 18:48:27 +02:00
bitromortac
42df51f2dd qt: remove node suggestion 2020-10-22 18:05:51 +02:00
bitromortac
b543874670 gossip: start gossiping when channel is open 2020-10-22 18:05:51 +02:00
bitromortac
4efcb53d24 network: load gossip db early
The gossip db is loaded early when the network is started to save
time when the gui is locked and a wallet not yet loaded. Side effects
of the LNWallet to start peering when a channel db is loaded is
circumvented.
2020-10-22 18:05:51 +02:00
bitromortac
6045de759b lightning: enable by default but without gossip
Enables lightning by creating a node private key and storing it in
the wallet. The gossiper is not launched at start up, only if there
are existing channels.
2020-10-22 18:05:51 +02:00
SomberNight
82c8c4280f
lnworker: add request_remote_force_close which can be used without state
see #6656
2020-10-17 03:59:50 +02:00
SomberNight
c3fb79d412
lnworker: make sure to save new channel before we broadcast
see #6656
2020-10-17 03:47:29 +02:00
SomberNight
1d187d36f0
(fix) allow opening LN wallet with --offline 2020-10-15 14:20:51 +02:00
SomberNight
4b6c86ecbe
wallet: make labels private, and access to need lock
e.g. labels plugin iterated over wallet.labels on asyncio thread while user could trigger an edit from Qt thread
2020-10-13 18:57:55 +02:00
SomberNight
6443bb7d8d
SqlDB: fix thread-safety issues re asyncio.Future
exceptions below are raised when running python3 with "-X dev":

Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 999, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "...\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "...\electrum\electrum\sql_db.py", line 55, in run_sql
    future.set_result(result)
  File "...\Python38\lib\asyncio\base_events.py", line 721, in call_soon
    self._check_thread()
  File "...\Python38\lib\asyncio\base_events.py", line 758, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 3009, in closeEvent
    self.clean_up()  #
  File "...\electrum\electrum\gui\qt\main_window.py", line 3026, in clean_up
    self.gui_object.close_window(self)
  File "...\electrum\electrum\gui\qt\__init__.py", line 340, in close_window
    self.daemon.stop_wallet(window.wallet.storage.path)
  File "...\electrum\electrum\daemon.py", line 518, in stop_wallet
    wallet.stop()
  File "...\electrum\electrum\wallet.py", line 344, in stop
    self.lnworker.stop()
  File "...\electrum\electrum\lnworker.py", line 602, in stop
    super().stop()
  File "...\electrum\electrum\lnworker.py", line 273, in stop
    self.listen_server.close()
  File "...\Python38\lib\asyncio\base_events.py", line 337, in close
    self._loop._stop_serving(sock)
  File "...\Python38\lib\asyncio\proactor_events.py", line 849, in _stop_serving
    future.cancel()
  File "...\Python38\lib\asyncio\windows_events.py", line 80, in cancel
    return super().cancel()
  File "...\Python38\lib\asyncio\base_events.py", line 721, in call_soon
    self._check_thread()
  File "...\Python38\lib\asyncio\base_events.py", line 758, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
2020-10-06 19:24:10 +02:00
SomberNight
52bd0eb1a6
lnworker: minor improvements to 'lightning_listen' handling 2020-09-24 02:17:45 +02:00
SomberNight
c010aa327e
lnworker: (fix) a listening node would busy-loop if remote DC-ed early
StreamReader.read() returns b'' on EOF, resulting in a busy loop
2020-09-24 01:52:35 +02:00
MrNaif2018
6bd1a04aee
Pass wallet to invoice_status/request_status (#6595)
* Pass wallet to invoice_status/request_status

* Check for same wallet in qt gui

Co-authored-by: ghost43 <somber.night@protonmail.com>
2020-09-18 17:28:51 +00:00
SomberNight
35f1f2905b
lnpeer: forbid creating Peer with ourselves (self-connect)
related: #6583
2020-09-15 18:35:16 +02:00
ghost43
3eba26b398
LN cooperative close: avoid address-reuse (#6590)
Previously if we coop-closed multiple channels in the same session,
they would reuse the wallet address.
2020-09-15 15:37:47 +00:00
SomberNight
c54b9a6874
qt receive tab: fix creating new payreq with all used imported wallet
fixes #6325
2020-07-03 20:12:52 +02:00
SomberNight
700e62598d
history: allow changing default label of swaps 2020-06-25 19:12:11 +02:00
SomberNight
ce726f69aa
lnworker.add_peer: fix #6274 2020-06-25 18:53:14 +02:00
SomberNight
10c2183461
handle_error_code_from_failed_htlc: omg brainfart :(
follow-up 85841ba20d
2020-06-24 21:33:44 +02:00
SomberNight
662d0d92bd
remote watchtower: enforce that SSL is used, on the client-side 2020-06-24 16:57:50 +02:00
SomberNight
1495040f45
lnworker._check_invoice: add sanity check 2020-06-23 15:38:06 +02:00
SomberNight
d5f368c584
LN invoices: support msat precision
fixes #6250
2020-06-22 22:48:13 +02:00
ThomasV
4bda882695 Group swap transactions in Qt history (fixes #6237)
- use tree structure of QTreeView
 - grouped items have a 'group_id' field
 - rename 'Normal' swap as 'Forward'
2020-06-22 11:26:49 +02:00
SomberNight
85841ba20d
handle_error_code_from_failed_htlc: fix logic bug
the two asserts are supposed to be identical (one was negated)
2020-06-22 04:02:51 +02:00
SomberNight
06b0669251
lnworker: rm dead code 2020-06-21 05:17:56 +02:00
SomberNight
1321b0e47a
qt channel details: maybe fix #5728 2020-06-21 05:16:27 +02:00
ThomasV
b06daaa669 fix display of short_channel_id for channel backups 2020-06-19 19:38:19 +02:00
ThomasV
937d8a1f0f fix #6243 2020-06-19 17:41:51 +02:00
ThomasV
4344ca47b3 swaps: create invoice without saving the request 2020-06-19 10:31:18 +02:00
SomberNight
5401b3f72d
channel backups: try fixing force-close-trigger 2020-06-19 06:38:00 +02:00
SomberNight
4c70956687
filter callbacks to wallet: channel, payment_succeeded, payment_failed
It is ugly that the 'channel' callback takes a wallet I guess,
but with channel backups in one wallet, and active channels in another,
it was causing problems... (when open simultaneously)
2020-06-19 04:11:35 +02:00
SomberNight
1849206394
submarine_swaps: small clean-up 2020-06-18 18:18:33 +02:00
ghost43
c887c910c6
Merge pull request #6238 from SomberNight/202006_randomise_address_subscriptions
network: randomise the order of address subscriptions
2020-06-18 15:43:44 +00:00
ThomasV
f9788a5d90 channel backups: add MAC 2020-06-18 15:03:16 +02:00
ThomasV
26ae6d68a3 add encryption version to channel backups 2020-06-18 15:03:16 +02:00
ThomasV
cb4c8abe1c submarine swaps: disable merging of transaction in history
This is too complicated and ugly because it relies on side
effects. What we should do instead is collapse transactions
in children nodes of QTreeView (see #6237)
2020-06-18 14:28:40 +02:00
ThomasV
a1e8f9e2aa swaps: mapping of prepay_hash to payment_hash 2020-06-18 14:28:40 +02:00
ThomasV
c8506eaa39 swaps: store fee_preimage 2020-06-18 14:28:40 +02:00
ThomasV
3874f7ec77 swaps: use StoredObject to store data 2020-06-18 14:28:40 +02:00
ThomasV
fa399f3471 swaps: show time left until tx can be refunded 2020-06-18 14:28:40 +02:00
ThomasV
252591832a swaps: improve history display 2020-06-18 14:28:40 +02:00
ThomasV
f8dd62aec0 show swaps as single line in history
main_window.run_coroutine_from_thread
2020-06-18 14:28:40 +02:00
ThomasV
17ff6ffa08 submarine_swaps: add SwapManager 2020-06-18 14:28:40 +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
SomberNight
a32cb7784f
myAiohttpClient: add id counter, and rename to JsonRPCClient 2020-06-09 17:50:06 +02:00
ThomasV
30f5be26ac Remove dependencies: jsonrpcserver, jsonrpcclient 2020-06-09 11:26:39 +02:00
ThomasV
0c17954d37 do not create backups for channels that do not have static_remotekey 2020-06-06 12:28:08 +02:00
ThomasV
0878fe08f7 do not display 'Expires in 100 years' for LN invoices 2020-06-01 22:18:08 +02:00
ThomasV
6058829870 Use attr.s classes for invoices and requests:
- storage upgrade
 - fixes #6192
 - add can_pay_invoice, can_receive_invoice to lnworker
2020-06-01 21:02:45 +02:00
SomberNight
530a446172
follow-up prev: don't reuse funding tx change address for static_remotekey
see comment in code
2020-05-22 17:19:55 +02:00