Commit graph

439 commits

Author SHA1 Message Date
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
SomberNight
6040e953a3
wallet: implement reserving addresses, and use it for LN SRK to_remote
- Use change addresses (instead of receive) for the static_remotekey to_remote outputs,
  and reserve these to greatly reduce the chance of address-reuse
- Use change addresses (instead of receive) for LN channel sweep addresses.
  Note that these atm are not getting reserved.
2020-05-22 17:19:51 +02:00
SomberNight
f8c574b699
wallet: (fix) get_receiving_address must always return an addr
- also, disallow deleting last address from an imported wallet (fixes #3254, fixes #4833)
- also, set LNBackups.sweep_address lazily, as during fresh wallet creation
  there are no addresses in the wallet at that point yet! see trace below.

Traceback (most recent call last):
  [...]
  File "...\electrum\electrum\tests\test_commands.py", line 112, in test_export_private_key_deterministic
    wallet = restore_wallet_from_text('bitter grass shiver impose acquire brush forget axis eager alone wine silver',
  File "...\electrum\electrum\wallet.py", line 2575, in restore_wallet_from_text
    wallet = Wallet(db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2502, in __new__
    wallet = WalletClass(db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2346, in __init__
    Deterministic_Wallet.__init__(self, db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2147, in __init__
    Abstract_Wallet.__init__(self, db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 261, in __init__
    self.lnbackups = LNBackups(self)
  File "...\electrum\electrum\lnworker.py", line 1401, in __init__
    self.sweep_address = wallet.get_receiving_address()
  File "...\electrum\electrum\wallet.py", line 1498, in wrapper
    addr = func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet.py", line 1520, in get_receiving_address
    raise Exception("no receiving addresses in wallet?!")
Exception: no receiving addresses in wallet?!
2020-05-22 16:25:33 +02:00
SomberNight
f9de6a5354
tests: lnpeer: make debug htlc failure hooks more uniform 2020-05-14 19:15:32 +02:00
SomberNight
c034219c5a
ln invoices: more relaxed filtering of chans to include route hints for
e.g. just because remote peer is temporarily offline, we might still want it
included in the invoice
2020-05-11 16:01:33 +02:00
ThomasV
1788e5c1c0 lnworker: catch exceptions raised in decode_msg 2020-05-11 10:31:49 +02:00
ThomasV
e2c2c89988 follow-up prev 2020-05-10 22:11:09 +02:00
ThomasV
0070e5036c follow-up previous commit 2020-05-10 21:45:10 +02:00
ThomasV
984da7515a fix #6125: detect self-payments 2020-05-06 12:58:55 +02:00
SomberNight
cc4029c335
test_lnpeer: add some multi-hop payment unit tests 2020-05-06 11:06:44 +02:00
SomberNight
7153e753d1
lnworker._pay: allow specifying path as argument
not exposed to CLI/etc yet but will be used in tests soon
2020-05-06 11:06:40 +02:00