Commit Graph

14455 Commits

Author SHA1 Message Date
SomberNight 0d854555c8 change top-level README from .rst to .md
- markdown is just simpler. less powerful but more than sufficient here
- all the other doc files in this repo are markdown
2022-06-09 17:33:13 +02:00
SomberNight 8674fd96d5 lnworker: also check expiring_htlcs in ChannelState.SHUTDOWN
otherwise the remote could intentionally send "shutdown" during an attack
2022-06-07 22:37:25 +02:00
SomberNight f7573dbce6 qt main_window: (trivial) rm dead code, and fix copy-paste error 2022-06-07 19:57:53 +02:00
SomberNight 90dbac5a65 lnpeer: make "trigger_force_close" work with eclair 0.7+ remotes 2022-06-07 19:53:27 +02:00
SomberNight 82518304b3 release notes: mention security fix in 4.2.2 2022-06-07 16:24:07 +02:00
ThomasV 0ed4fea899 Revert "num_sats_can_receive: bucket channels that we have with the same node"
This reverts commit c06a9ccb9c.
2022-06-05 09:10:32 +02:00
ThomasV c06a9ccb9c num_sats_can_receive: bucket channels that we have with the same node 2022-06-04 11:17:21 +02:00
SomberNight 450476dcb6 qt seed_dialog: warn when trying to restore standard seed as 2FA wallet
closes https://github.com/spesmilo/electrum/issues/7837
2022-06-03 19:05:48 +02:00
SomberNight 780408285c qt "Wallet Info" dialog: show bip32 root fingerprint
and also show it in DeviceMgr.select_device

follow-up https://github.com/spesmilo/electrum/commit/998cd0d356fcd9ed1bd835c3a1abe81737a8b73b
2022-06-03 18:02:58 +02:00
SomberNight 574243b897 hww ledger: call scan_devices fewer times 2022-06-03 17:14:51 +02:00
SomberNight 998cd0d356 hww: make DeviceMgr.select_device dlg msg more explicit (add details)
related https://github.com/spesmilo/electrum/issues/4199#issuecomment-1145063552
2022-06-03 17:14:47 +02:00
SomberNight b5d3f1458a hww: impl get_client in Hardware_KeyStore instead of subclasses 2022-06-03 17:14:44 +02:00
SomberNight 745e697188 hww: move trigger_pairings to DeviceMgr 2022-06-03 17:14:40 +02:00
ThomasV a0e791a6e5 If util.trigger_callback() is called from the asyncio loop,
run the callback synchronously.
2022-06-03 16:38:47 +02:00
SomberNight a758c99bbe kivy: add "clear all gossip" button in ln gossip dialog
One usecase is perhaps to save space if using trampoline anyway...
more importantly, if using gossip, LNGossip is heavily filtering what messages we request and get,
and e.g. can missing new NodeAnnouncements, etc,
and this is a quick-and-dirty workaround to force a fresh start.
2022-06-02 18:28:21 +02:00
SomberNight fbc750bab1 qt.util: HelpLabel, HelpButton, InfoButton: factor out HelpMixin
based on https://github.com/Electron-Cash/Electron-Cash/commit/3ca8854007556363c6ef201aac5fe275294abf7e

Co-authored-by: Calin Culianu <calin.culianu@gmail.com>
2022-06-02 15:25:07 +02:00
Jonas Lundqvist b7b53e56bc Qt PayToEdit: add option to scan QR code from screen(shot)
this ports the following commits:
https://github.com/Electron-Cash/Electron-Cash/commit/448376e4410951f12f53ce42b59bdfe856afc66b
https://github.com/Electron-Cash/Electron-Cash/commit/6053f6f696c3f65a93a84e570454e8a1d8c5f490
2022-06-01 19:10:01 +02:00
SomberNight 9d125118da qrreader.get_qr_reader: raise instead of returning None
move MissingQrDetectionLib to core lib
2022-06-01 18:54:24 +02:00
Axel Gembe 01d20cba49 qt PayToEdit: various fixes, incl icon size/pos, field size, scrollbar
this ports https://github.com/Electron-Cash/Electron-Cash/pull/1371

including commits:
---
https://github.com/Electron-Cash/Electron-Cash/commit/bab816e2c3ace1624f6e981e947bcf1440728852

Buttons Editor: Make background non-transparent and change to push button

There were some issues with transparent backgrounds with QToolButton on
Linux and as there is no real reason for them to be transparent we just
make them opaque.
---
https://github.com/Electron-Cash/Electron-Cash/commit/2cb698affc3ddf1049f1fdd5d55a842b9b7c192b
Pay to editor: Fix size computations to use the proper values

Previously this did not take into account the spacing between lines nor
the margins of the control and the document. There is also a sensible
minimum height of one line now and it expands to up to 10 lines before
we show the scroll bar. When the scroll bar is active, we move the buttons
so they do not obscure the scroll bar.
---
https://github.com/Electron-Cash/Electron-Cash/commit/1b7a70f4f5b9362ca83d4d35627135bbd0d19aec
Pay to editor: Increase height by one if cursor is under buttons
---
https://github.com/Electron-Cash/Electron-Cash/commit/abd42d9f664960210d0c2df29c6ff9dfd6d44015
 Buttons Editor: Always center if the document is just one line high
---
https://github.com/Electron-Cash/Electron-Cash/commit/33bd0b82e0fac5bfd2447b06668889fa249213c9
Pay to editor: Make button movement on scrollbar change reliable
---
https://github.com/Electron-Cash/Electron-Cash/commit/94f8476c2e89584275280de280a93a18ad0194a3
Pay to editor: Use document lineCount instead of height
---
https://github.com/Electron-Cash/Electron-Cash/commit/5bedfce392a0aac0345a1c070c72d75d9449ea18
Buttons Editor: Improve vertical centering of the buttons, needs to take into account the frame width
---
https://github.com/Electron-Cash/Electron-Cash/commit/0cd0b490c45620a5700b0c1ccfad5d3593dbe6ff
Buttons Editor: Add transparent border which is somehow needed for correct macOS layout
2022-06-01 18:24:37 +02:00
Axel Gembe 2d1727520f qt ButtonsWidget: refactor into OverlayControlMixin; fix alignmt/hover
This ports the following:
https://github.com/Electron-Cash/Electron-Cash/commit/782f213bbd945bb4e74dc73116afdaac5ddc9d84
https://github.com/Electron-Cash/Electron-Cash/commit/2e5af27a7ce65c3da6632b4787c70ff8359a8d2c
https://github.com/Electron-Cash/Electron-Cash/commit/889fcbd26aa85dd0c0b8a9537071c816e996835e
https://github.com/Electron-Cash/Electron-Cash/commit/c07b0ad616f136dc6c9f52d825d5a2add59a5175
2022-06-01 17:27:32 +02:00
Axel Gembe 798dbca880 qt ButtonsWidget: Don't pass app instance to addCopyButton
Doesn't make sense to pass the application when we can just use
QApplication.instance() instead.

from https://github.com/Electron-Cash/Electron-Cash/commit/54ccf640c5f9f1eb3e38a644f8da3bd7ed1f93dd
2022-06-01 17:01:21 +02:00
SomberNight abe3955d91 qt.util.ButtonsWidget: add custom setText arg to methods
I am planning to use this in qt.PayToEdit.
2022-05-31 16:40:22 +02:00
SomberNight 32f88ae419 util: rm a magic number 2022-05-30 21:42:52 +02:00
SomberNight 5e0df77df6 kivy: fix threading issue when scanning bip70 qr code on newer kivy
kivy 2.1 seemingly became more sensitive to threading issues.
This used to work on kivy 2.0 and older, but 2.1 is complaining.

```
I | paymentrequest | Error while contacting payment URL: https://bitpay.com/i/... -- error type: <class 'aiohttp.client_exceptions.ClientResponseError'> -- Got HTTP status code 404.
E | util | Exception in get_payment_request: TypeError('Cannot create graphics instruction outside the main Kivy thread')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1175, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/util.py", line 1033, in get_payment_request
    on_pr(request)
  File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 460, in on_pr
    self.show_error("invoice error:" + pr.error)
  File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1066, in show_error
    self.show_info_bubble(text=error, icon=icon, width=width,
  File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1092, in show_info_bubble
    info_bubble = self.info_bubble = Factory.InfoBubble()
  File "/usr/local/lib/python3.8/dist-packages/kivy/uix/bubble.py", line 199, in __init__
    self._arrow_layout = BoxLayout()
  File "/usr/local/lib/python3.8/dist-packages/kivy/uix/boxlayout.py", line 145, in __init__
    super(BoxLayout, self).__init__(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/kivy/uix/layout.py", line 76, in __init__
    super(Layout, self).__init__(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/kivy/uix/widget.py", line 361, in __init__
    self.canvas = Canvas(opacity=self.opacity)
  File "kivy/graphics/instructions.pyx", line 608, in kivy.graphics.instructions.Canvas.__init__
  File "kivy/graphics/instructions.pyx", line 154, in kivy.graphics.instructions.InstructionGroup.__init__
  File "kivy/graphics/instructions.pyx", line 60, in kivy.graphics.instructions.Instruction.__init__
TypeError: Cannot create graphics instruction outside the main Kivy thread
```
2022-05-30 21:19:50 +02:00
SomberNight 06687e06d8 lnpeer: forwarding: better handle if next_peer is offline 2022-05-30 16:46:31 +02:00
ThomasV cc1b4a5c90 lnpeer: fix ping behavior.
- Do not send ping if messages have been received recently.
 - Do not send more than one ping.
 - Await pong before sending commitment_signed (per BOLT-2)
 - Lower ping time to 30s
2022-05-30 09:31:42 +02:00
ThomasV c1c6c01e87 rebalance dialog: fix button disabling 2022-05-29 19:00:52 +02:00
ThomasV 8750936679 Rebalance dialog:
- move dialog code to own submodule and class
 - disable ok button if amount is out of bounds
 - add max button
 - add Rebalance button to channels tab
2022-05-29 18:40:45 +02:00
ThomasV 38b155c631 Qt receive widgets: factorize code 2022-05-29 13:54:38 +02:00
ThomasV ce96d1f97b lnworker: create_routes_for_payment: try random order
without this, we keep retrying with the same trampoline when payment fails
2022-05-29 12:38:16 +02:00
ThomasV cd54244956 lnworker: in sugest_channels_for_rebalance, delta depends on the channel
Also, safety margin can be reduced.
2022-05-29 11:58:49 +02:00
SomberNight ae76a0daf5 windows binaries: try to prevent users from renaming exe while running
closes https://github.com/spesmilo/electrum/issues/4072
(this fix AFAICT only works on Windows, and #4072 contains some macOS reports as well,
however all recent reports are for Windows and overall most reports are for Windows,
so let's close it optimistically for now)
2022-05-29 03:26:20 +02:00
ThomasV 00183b5412 Qt: move current_request logic from main_window to requests_list 2022-05-28 17:52:07 +02:00
SomberNight 52b73880f9 requirements: pin protobuf "<4"
protobuf 4.x introduced breaking changes compared to 3.20.
To adapt, we would have to regenerate paymentrequest_pb2.py, using protoc>=3.19.0, however ubuntu does not have new enough protoc.
Also, unsure if newly generated paymentrequest_pb2.py would be supported by older versions of protobuf.
Best to just wait for things to settle.

```
electrum/__init__.py:20: in <module>
    from .wallet import Wallet
electrum/wallet.py:70: in <module>
    from . import transaction, bitcoin, coinchooser, paymentrequest, ecc, bip32
electrum/paymentrequest.py:37: in <module>
    from . import paymentrequest_pb2 as pb2
electrum/paymentrequest_pb2.py:36: in <module>
    _descriptor.FieldDescriptor(
.tox/py3/lib/python3.9/site-packages/google/protobuf/descriptor.py:560: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```

https://github.com/protocolbuffers/protobuf/blob/ceaae1b6a3acca823acc40380a96f94cecc6e6a9/CHANGES.txt#L47
2022-05-27 18:38:26 +02:00
SomberNight 8e9274bde4 mac build: README: add more details about installing Xcode 2022-05-27 17:51:53 +02:00
SomberNight ecf4e3db48 mac build: compare_dmg script: if binaries mismatch, print the diff 2022-05-27 17:48:18 +02:00
SomberNight 3e290c9d47 update release notes for 4.2.2
(from 4.2.x branch)
2022-05-27 17:33:35 +02:00
ThomasV 3ce42edbab update locale submodule 2022-05-27 12:17:41 +02:00
ThomasV 7cf495d1e0 Windows build scripts: Read codesign passphrase. Lazy check if unsigned binaries are there. 2022-05-27 11:07:32 +02:00
SomberNight 58be69afd3 commands: add "encrypt_file" arg to "password" command 2022-05-26 21:41:29 +02:00
SomberNight d04e3c7288 bip70 paymentrequest: remove support for "file" URIs 2022-05-26 19:50:47 +02:00
SomberNight b7a3e07db8 bump version to 4.3.0a0 2022-05-26 19:10:29 +02:00
SomberNight 189390fb2d qt new_channel_dialog: use lnutil.MIN_FUNDING_SAT instead of ad-hoc val 2022-05-26 18:08:15 +02:00
SomberNight ad42de03ac qt new_channel_dialog: fix regression: oepn chan with "max" amt
```
E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\channels_list.py", line 377, in new_channel_with_warning
	self.new_channel_dialog()
  File "...\electrum\electrum\gui\qt\channels_list.py", line 399, in new_channel_dialog
	return d.run()
  File "...\electrum\electrum\gui\qt\new_channel_dialog.py", line 133, in run
	if self.min_amount_sat and funding_sat < self.min_amount_sat:
TypeError: '<' not supported between instances of 'str' and 'int'
```
2022-05-26 18:05:18 +02:00
ThomasV 30a98578c8 Refactor: move calls to lnworker methods out of the tx creation functions
(follow-up f0237e46be)
2022-05-26 15:04:43 +02:00
ThomasV f0237e46be lnsweep: do not redeem offered HTLCs unless payment was received in full 2022-05-26 14:28:25 +02:00
ThomasV 672326bd12 lnwatcher: a bit less verbose 2022-05-26 12:00:11 +02:00
ThomasV 035c877813 channels_list: do not add extra whitespaces when displaying amounts in HTLCs 2022-05-26 09:04:46 +02:00
SomberNight 79578d6c18 lnchannel: fix diagnostic_name, for better log lines
Previously nothing re channel id was logged, as "diagnostic_name" is only evaluated once,
and it ran before channel_id was set.
2022-05-25 23:51:11 +02:00
ThomasV 58194ce78b Merge pull request #7830 from SomberNight/202205_lnpeer_reestablish_channel
lnpeer.reestablish_chan: enforce order of replaying commitsig/revack
2022-05-25 19:54:51 +02:00