1
0
Commit Graph

12710 Commits

Author SHA1 Message Date
SomberNight
2eec7e1600 network: smarter switch_unwanted_fork_interface
Previously this function would not switch to a different chain if the
current chain contained the preferred block. This was not the intended
behaviour: if there is a *stronger* chain that *also* contains the
preferred block, we should jump to that.

Note that with this commit there will now always be a preferred block
(defaults to genesis). Previously, it might seem that often there was none,
but actually in practice if the user used the GUI context menu to switch
servers even once, there was one (usually genesis).

Hence, with the old code, if an attacker mined a single header which
then got reorged, auto_connect clients which were connected to the
attacker's server would never switch servers (jump chains) even
without the user explicitly configuring preference for the stale branch.
2020-06-21 11:31:54 +02:00
SomberNight
9385d2dae3 submarine_swaps: minor clean-up (preimage/locktime) 2020-06-21 08:36:40 +02:00
SomberNight
1ace265992 wallet: simplify get_payment_status 2020-06-21 08:23:07 +02:00
SomberNight
3766420a0b network: clarify local_height/server_height 2020-06-21 08:20:56 +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
SomberNight
0f5b58851c servers: minor refresh to default lists 2020-06-20 03:24:34 +02:00
SomberNight
dcb6a168a0 update block header checkpoints 2020-06-20 02:33:30 +02:00
ThomasV
e30c752e19 kivy: improve channels list 2020-06-19 20:16:25 +02:00
ThomasV
b06daaa669 fix display of short_channel_id for channel backups 2020-06-19 19:38:19 +02:00
SomberNight
ea329063bf channel open: allow REMOTE to set htlc_minimum_msat to 0
non-positive values do not make sense... but some nodes set it to 0
and if we enforce >= 1 then we can't open channels with those...
lnchannel._assert_can_add_htlc enforces positive values for HTLCs in any case.
2020-06-19 18:15:09 +02:00
ThomasV
937d8a1f0f fix #6243 2020-06-19 17:41:51 +02:00
SomberNight
b55f6430f2 lnchannel: explain why if REMOTE f-closes we remain OPEN until mined 2020-06-19 16:31:09 +02:00
ThomasV
a03d8dc6ac swaps: add testnet url 2020-06-19 14:17:42 +02:00
ThomasV
aacddf008c trigger_force_close: set my_current_per_commitment_point to a valid point
We could as well derive the point from our channel_seed and ctn=0,
but that seems unnecessary. Related: #6241
2020-06-19 12:04:04 +02:00
ThomasV
4344ca47b3 swaps: create invoice without saving the request 2020-06-19 10:31:18 +02:00
SomberNight
3665f5d3fd fix channel backups for "not initiator" channels
bool(b'\x00') is True
2020-06-19 06:53:45 +02:00
SomberNight
5401b3f72d channel backups: try fixing force-close-trigger 2020-06-19 06:38:00 +02:00
SomberNight
182c192558 qt: easier import/export of channel backups 2020-06-19 04:48:20 +02:00
SomberNight
12e2beadd9 (trivial) qt: disable 'swap' button if lightning disabled 2020-06-19 04:15:37 +02:00
SomberNight
561ecaa226 follow-up prev 2020-06-19 04:13:41 +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
625f985f22 android: enable full logging if DEBUG build 2020-06-19 01:52:21 +02:00
SomberNight
fcbc1c9a45 submarine_swaps: increase min locktime delta for reverse swap to 60
10 blocks is not enough to get a tx confirmed without worrying...
2020-06-18 22:25:38 +02:00
SomberNight
c2ffc6ca3a qt swap_dialog: "max" now takes into account the server-provided value 2020-06-18 21:52:48 +02:00
ThomasV
a033cfeee8 submarine swaps: fee_invoice is now a hold invoice 2020-06-18 21:39:30 +02:00
SomberNight
abad2b6069 qt swap_dialog: implement "max" button for reverse swap 2020-06-18 21:37:40 +02:00
SomberNight
7570c8c1c6 qt swap_dialog: "max" button now respects max htlc value 2020-06-18 21:03:49 +02:00
SomberNight
a74552f3dd qt main_window: fix threading for run_coroutine_from_thread 2020-06-18 20:43:34 +02:00
SomberNight
a98fd14f8d qt swap_dialog: clean-up imports 2020-06-18 19:58:23 +02:00
SomberNight
2be2a510ff submarine_swaps: replace asserts with Exceptions 2020-06-18 19:45:07 +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
SomberNight
5f2d347d81 submarine_swaps: wallet.get_unused_address -> get_receiving_address 2020-06-18 17:11:14 +02:00
ThomasV
eb910ba14f Merge pull request #6236 from spesmilo/channel_backup_version
Channel backup version
2020-06-18 15:17:13 +02:00
SomberNight
e1a2299f0c channel backup versions: trivial clean-up 2020-06-18 15:03:16 +02:00
ThomasV
f9788a5d90 channel backups: add MAC 2020-06-18 15:03:16 +02:00
ThomasV
6922d81a1e channel backups: add another version number, for the backup itself 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
77c2aa5017 add Max button to swap dialog, fix fee slider behaviour when max is selected 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
540dd73f3b Submarine swaps:
- improve gui
 - allow coin selection
 - allow spending 'max'
2020-06-18 14:28:40 +02:00
ThomasV
ee59ad13c4 support new protocol (minerFeeInvoice) 2020-06-18 14:28:40 +02:00
ThomasV
bcf2246633 minor fix 2020-06-18 14:28:40 +02:00
ThomasV
e6e6103434 swaps: add safeguards to gui 2020-06-18 14:28:40 +02:00
ThomasV
5fa09970b6 swaps: move fee logic to swap_manager, fix command line 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
a73f24e826 swaps: perform 10 payment attempts 2020-06-18 14:28:40 +02:00