Commit graph

425 commits

Author SHA1 Message Date
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
SomberNight
7951f2ed3b
lnworker.pay: small clean-up 2020-05-06 04:02:59 +02:00
SomberNight
7d3eb5d4db
(trivial) follow-up c1b1638615 2020-05-06 04:01:56 +02:00
ThomasV
7b44e27087 lnpay: return payment log, increase timeout 2020-05-05 18:32:43 +02:00
ThomasV
d7b853f271 follow-up 8ba7e68064 2020-05-05 15:40:13 +02:00
ThomasV
c1b1638615 fix htlc forwarding:
- persist fail_htlc error messages
 - do not rely on payment_hash in htlc_switch
2020-05-05 09:23:48 +02:00
ThomasV
abe1bece2c remove UnknownPaymentHash (exception used as value) 2020-05-02 22:37:28 +02:00
SomberNight
2b1a150c52
multi-wallet: properly stop lnworker/lnwatcher 2020-05-01 04:50:08 +02:00
SomberNight
6f7a4ab048
lnpeer: add get_channel_by_id, for small speed-up 2020-04-30 21:13:29 +02:00
SomberNight
b9b53e7f76
lnworker: fix threading issues for .channels attribute
external code (commands/gui) did not always take lock when iterating lnworker.channels.
instead of exposing lock, let's take a copy internally (as with .peers)
2020-04-30 21:08:26 +02:00
ThomasV
f4dc93cb7d lnworker: blacklist channel if policy is unchanged but has a new timestamp. 2020-04-24 12:16:21 +02:00
ThomasV
2d0ef78a11 channel_db: add verbose option to add_channel_update 2020-04-24 11:45:39 +02:00
SomberNight
f52072e169
follow-up prev
we can't just test with a 1 msat htlc as that might be below htlc_minimum_msat
2020-04-18 18:51:20 +02:00
SomberNight
12d771737a
fix #6096: bugfix for creating zero amount LN invoice
(also there was a unit-mismatch here...)
2020-04-18 05:56:12 +02:00
ThomasV
ef5ad5f22f extend 'add_peer', 'list_peers' commands to gossip 2020-04-16 12:39:12 +02:00