1
0
Commit Graph

13523 Commits

Author SHA1 Message Date
ThomasV
7c2b7ca5c0 add channel backups to result returned by list_channels 2021-03-12 18:53:09 +01:00
SomberNight
1ba5997238 qt lightning_tx_dialog: use historical fx rate for fiat amounts 2021-03-12 18:29:00 +01:00
SomberNight
24e4aa3ab9 network.best_effort_reliable: use curio APIs instead of asyncio 2021-03-12 17:53:13 +01:00
ThomasV
65d263801a show capacity of channel backups in GUI 2021-03-12 17:39:13 +01:00
SomberNight
3ff203ea51 commands: fix list_requests
closes https://github.com/spesmilo/electrum/issues/7102
2021-03-12 17:38:19 +01:00
SomberNight
897f90d6e8 wallet: factor out "what key to use for invoice"
fix: qt request list was not using the correct key
2021-03-12 17:29:54 +01:00
ThomasV
1a4e55a911 follow-up 90b228de83 2021-03-12 16:38:48 +01:00
ThomasV
8984db3384 follow-up 90b228de83 2021-03-12 16:28:56 +01:00
ThomasV
af7bcd4ca1 add comments about ChannelBackup fields 2021-03-12 16:11:47 +01:00
ThomasV
f16358ec3c add request_force_close command to CLI
add regtest for channel backup
2021-03-12 16:10:02 +01:00
ThomasV
bed4ddbcb4 fix dict value assignment bug in import_channel_backup. In request_force_close, use Taskgroup with wait=any 2021-03-12 16:09:24 +01:00
ThomasV
e186214f6f (formatting) lnsweep indentation 2021-03-12 12:41:10 +01:00
ThomasV
90b228de83 fix wallet get_full_history: add onchain tx for channels not opened by us 2021-03-12 12:15:39 +01:00
ThomasV
6004a04705 Merge pull request #7099 from SomberNight/202103_fail_pending_htlcs_on_shutdown
fail pending htlcs on shutdown
2021-03-12 11:01:07 +01:00
SomberNight
2487a3fa90 tests: add test for prev 2021-03-11 20:35:21 +01:00
SomberNight
cb78f73ed0 lnworker: try to fail pending HTLCs when shutting down
This is most useful when receiving MPP where there is a non-trivial chance
that we have received some HTLCs for a payment but not all, and the user
closes the program. We try to fail them and wait for the fails to get
ACKed, with a timeout of course.
2021-03-11 19:31:22 +01:00
SomberNight
05e58671c9 lnhtlc: (trivial) rename method 2021-03-11 19:09:35 +01:00
SomberNight
54f7755397 lnpeer.maybe_forward_htlc: add FIXME 2021-03-11 18:51:45 +01:00
SomberNight
28a7d204ad util: document CallbackManager behaviour 2021-03-11 18:50:59 +01:00
ThomasV
533d796a41 add TODO, rename check_received_mpp_htlc 2021-03-11 16:53:55 +01:00
bitromortac
10c799faab mpp_split: add penalty for exhaustion of channels
A penalty is added for split configurations which saturate a channel.
Saturation of channels is discouraged as we don't know the fees
beforehand. The penalty is accomplished via an exponential function that
kicks in when the subamount reaches about the total funds available
(this amount is controlled by the parameter EXHAUST_DECAY_FRACTION).
2021-03-11 16:19:15 +01:00
ThomasV
1b7d8c0387 Qt: rm gossip menu item: already available in toolbar, and channel_db is not always present 2021-03-11 14:44:13 +01:00
ThomasV
dc55cf4b2d test_multipart_payment_with_timeout: give extra time for second HTLC to timeout before next test 2021-03-11 11:01:35 +01:00
ThomasV
50ab8be7a2 lnpeer: try to fix tests 2021-03-11 10:39:39 +01:00
SomberNight
707a58abf1 crypto: add comment about ripemd.py
related: https://github.com/spesmilo/electrum/issues/7093
2021-03-10 21:28:17 +01:00
SomberNight
a7c948bac1 tests: fix tearDown() issue in test_lnrouter.py
similar to 05fd424548

from logs when running tests:

--- Logging error ---
Traceback (most recent call last):
  File "...\Python39\lib\logging\__init__.py", line 1082, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "...\Python39\lib\threading.py", line 912, in _bootstrap
    self._bootstrap_inner()
  File "...\Python39\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "...\Python39\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "...\electrum\electrum\sql_db.py", line 71, in run_sql
    self.logger.info("SQL thread terminated")
Message: 'SQL thread terminated'
Arguments: ()
2021-03-10 21:23:41 +01:00
ThomasV
4250f3b8a1 test_lnpeer: use 2s MPP_TIMEOUT, and split test_multipart_payment_with_timeout 2021-03-10 21:06:50 +01:00
SomberNight
05fd424548 tests: maybe fix tearDown() issue in test_storage_upgrade.py
from travis logs:

--- Logging error ---

Traceback (most recent call last):
  File "/opt/python/3.7.6/lib/python3.7/logging/__init__.py", line 1028, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.

Call stack:
  File "/opt/python/3.7.6/lib/python3.7/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/opt/python/3.7.6/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/home/travis/build/spesmilo/electrum/electrum/plugin.py", line 213, in run
    self.run_jobs()
  File "/home/travis/build/spesmilo/electrum/electrum/util.py", line 359, in on_stop
    self.logger.info("stopped")
Message: 'stopped'
2021-03-10 20:16:25 +01:00
SomberNight
5339e0054c network.stop: clean-up 2021-03-10 19:01:30 +01:00
SomberNight
de6f5a8e03 {daemon,wallet}|.stop: small clean-up 2021-03-10 18:07:15 +01:00
SomberNight
eaa4de3354 kivy crash_reporter: a bit more logging 2021-03-10 17:38:53 +01:00
SomberNight
151a45911f follow-up prev: too much copy-paste 2021-03-10 17:31:02 +01:00
SomberNight
9740744d70 crypto: add chacha20_decrypt; unused for now 2021-03-10 17:13:42 +01:00
ThomasV
549b9a95df test_lnpeer: add test for mpp_timeout 2021-03-10 17:09:07 +01:00
SomberNight
d4de25a8cd crash reports: fix get_git_version for kivy 2021-03-10 16:23:49 +01:00
ThomasV
6620974f3d follow-up 652d10aa5f 2021-03-10 15:26:39 +01:00
SomberNight
0e01db4cee kivy: fix GridLayout orientations all over
Pre kivy 2.0, "orientation" was undefined for GridLayouts, not sure why we were setting it, it was a no-op.
kivy 2.0 added meaning to the field, and the values we were setting it to are invalid.

related:
https://github.com/kivy/kivy/pull/6741
https://github.com/kivy/kivy/issues/7142

-----

traceback:

E | gui.kivy.uix.dialogs.crash_reporter.ExceptionHook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
    setattr(widget_set, key, value)
  File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
  File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
  File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "kivy/_clock.pyx", line 645, in kivy._clock.CyClockBase._process_events
  File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/ui_screens/receive.kv", line 141, in <lambda>
    on_release: Clock.schedule_once(lambda dt: s.expiration_dialog(s))
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 517, in expiration_dialog
    d = ChoiceDialog(_('Expiration date'), pr_expiration_values, self.expiry(), callback)
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/dialogs/choice_dialog.py", line 53, in __init__
    Factory.Popup.__init__(self)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/modalview.py", line 187, in __init__
    super(ModalView, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/anchorlayout.py", line 68, in __init__
    super(AnchorLayout, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/layout.py", line 76, in __init__
    super(Layout, self).__init__(**kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 359, in __init__
    self.apply_class_lang_rules(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/uix/widget.py", line 463, in apply_class_lang_rules
    Builder.apply(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 541, in apply
    self._apply_rule(
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 710, in _apply_rule
    raise BuilderException(rule.ctx, rule.line,
kivy.lang.builder.BuilderException: Parser: File "<inline>", line 21:
...
     19:            GridLayout:
     20:                row_default_height: '48dp'
>>   21:                orientation: 'vertical'
     22:                id: choices
     23:                cols: 2
...
ValueError: GridLayout.orientation is set to an invalid option 'vertical'. Must be one of: ['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']
  File "/home/user/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 705, in _apply_rule
    setattr(widget_set, key, value)
  File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.__setattr__
  File "kivy/properties.pyx", line 498, in kivy.properties.Property.__set__
  File "kivy/properties.pyx", line 542, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 533, in kivy.properties.Property.set
  File "kivy/properties.pyx", line 1253, in kivy.properties.OptionProperty.check
2021-03-10 14:59:47 +01:00
ThomasV
7ae82c8230 Revert "lnworker: simplify request_force_close_from_backup"
This reverts commit ce88b36e81.
2021-03-10 12:54:00 +01:00
gruve-p
abc155b688 Appimage build: update git=1:2.7.4-0ubuntu1.10 15b5d9d (#7091) 2021-03-09 23:35:02 +00:00
SomberNight
8de52bf523 wallet: (trivial) use kwargs for get_tx_item_fiat 2021-03-09 18:22:30 +01:00
SomberNight
3c019c2f9c daemon/wallet/network: make stop() methods async 2021-03-09 17:52:36 +01:00
ThomasV
ce88b36e81 lnworker: simplify request_force_close_from_backup 2021-03-09 12:28:25 +01:00
ThomasV
652d10aa5f Remove LNBackups object: no longer needed since LNWorker is instantiated by default. 2021-03-09 11:52:04 +01:00
ThomasV
ef661050c8 lnworker: set request status after LN payment 2021-03-09 09:35:43 +01:00
SomberNight
a125cd5392 tests: test payreq status after getting paid via LN
The test failures corresponding to single-part (non-MPP) payments expose a bug.

see 196b4c00a3/electrum/lnpeer.py (L1538-L1539)
`lnworker.add_received_htlc` is not called for single-part payments...
2021-03-08 22:18:06 +01:00
SomberNight
f662859e5c test_lnpeer: (trivial) prepare_invoice to return both LnAddr and str 2021-03-08 21:46:56 +01:00
SomberNight
4069b455d0 lnaddr: add get_features method 2021-03-08 21:36:27 +01:00
ThomasV
196b4c00a3 Use new value of option_trampoline_routing flag, add it to our invoices.
Keep supporting old value for Eclair/Phoenix.
Do not add trampoline_routing_hints in invoices.
2021-03-08 19:16:48 +01:00
SomberNight
0491da2c66 lnpeer: (trivial) log htlc in on_update_add_htlc 2021-03-08 18:51:52 +01:00
ThomasV
fd48b96335 follow-up prev commit 2021-03-08 17:45:00 +01:00