1
0
Commit Graph

13739 Commits

Author SHA1 Message Date
SomberNight
9a38c4d2a1 logging: don't lose log messages during early startup
Previously, during early-startup (until configure_logging(config) is
called in run_electrum),
- the stderr log handler lost all log messages below warning level, and
- the file log handler lost all log messages regardless of log level

We now instead start buffering log messages in memory as soon as
electrum.logging is imported. The buffer is dumped into the
stderr and file log handlers when they are fully set up, and then
the buffer is discarded (and the temporary log handler is removed).

Note that messages are not logged until configure_logging() is called.
Previously WARNING/ERROR messages would get logged immediately to stderr,
but not anymore. This was changed so that the order of the log messages
can be kept intact. (if we log WARNINGs immediately, but need to delay
INFOs until the config is available, messages would either be out of order
or alternatively there would be duplicates)

Relatedly, we now follow the recommendation of the python docs re
logging for libraries [0]: we try to only configure logging if running via
run_electrum (the main script) and not when e.g. a 3rd party script
imports electrum.

[0]: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
2021-04-14 19:14:26 +02:00
SomberNight
6650e6bbae logging: (move-only) move module level code to near the end 2021-04-14 19:13:27 +02:00
SomberNight
67c6f0e1bd wallet: make sure we don't create zero input txs
fixes #7207
2021-04-14 19:08:04 +02:00
SomberNight
7335a584e7 logging: handle "cannot delete old logfile" error
E.g. on Windows, files open in one process cannot be deleted by another process.
With file logging enabled, if an old logfile was open in a text editor,
Electrum could crash during startup.

```
E | __main__ |
Traceback (most recent call last):
  File "...\electrum\run_electrum", line 391, in main
    handle_cmd(
  File "...\electrum\run_electrum", line 403, in handle_cmd
    configure_logging(config)
  File "...\electrum\electrum\logging.py", line 278, in configure_logging
    _configure_file_logging(log_directory)
  File "...\electrum\electrum\logging.py", line 107, in _configure_file_logging
    _delete_old_logs(log_directory)
  File "...\electrum\electrum\logging.py", line 98, in _delete_old_logs
    os.remove(str(f))
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '...\\AppData\\Roaming\\Electrum\\testnet\\logs\\electrum_log_20210414T023751Z_25008.log'
```
2021-04-14 05:10:54 +02:00
SomberNight
12fac3a167 fix running with --offline 2021-04-13 19:05:07 +02:00
SomberNight
4e91555d56 appimage build: bundle dependencies of Qt xcb plugin
fixes #7198

We recently bumped the bundled version of PyQt (5.14.2->5.15.4).
It seems the new version has a lot more dynamic dependencies.

From https://doc.qt.io/qt-5/linux-requirements.html :
> From Qt 5.15 onwards, Qt does require libxcb 1.11. Also, the -qt-xcb
> configure option got removed that was bundling some of the libs below.

We are using the prebuilt wheels for PyQt5 from PyPI. Presumably those
had previously been built using the -qt-xcb option.
2021-04-12 18:21:57 +02:00
SomberNight
1d8b1ef698 dnssec: trivial clean-up
- rm unused imports
- mark private API as private
- don't catch BaseException
2021-04-08 19:49:43 +02:00
Alex Recuenco
bc72e0fc15 Prevent spaces from causing issues in make_osx (#7191)
In some places in the script if some directory name had spaces it could cause issues. 

I also added quotes around a few other directory names that currently are hardcoded with names without spaces as a way to prevent any future mishap
2021-04-08 15:12:14 +00:00
ghost43
29d13eb32f Merge pull request #6001 from SomberNight/20200228_make_seed_not_bip39
mnemonic: make sure newly generated seeds are not valid as bip39
2021-04-08 14:27:20 +00:00
SomberNight
9f08293c0e mnemonic: make sure newly generated seeds are not valid as bip39 2021-04-08 16:24:10 +02:00
SomberNight
b7a8b1aae6 prepare release 4.1.2 4.1.2 2021-04-08 15:22:40 +02:00
ThomasV
2c39f0c9c4 fix #7190 2021-04-08 15:12:32 +02:00
ThomasV
842ecd2da6 android Makefile: do not try to deploy and run 2021-04-08 14:55:31 +02:00
SomberNight
0ee9442972 qt update notifications: add another key for redundancy 2021-04-08 14:39:36 +02:00
ThomasV
5ac130a88c Merge pull request #7187 from SomberNight/202104_android_adaptiveicon
android: update app icon; use "adaptive icons" on API 26+
2021-04-08 13:41:39 +02:00
SomberNight
3d9798757d android: update app icon; use "adaptive icons" on API 26+
see https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive

p4a and buildozer had to be patched for this; I will try to upstream the patches, see:
https://github.com/kivy/python-for-android/pull/2446
https://github.com/kivy/buildozer/pull/1312
2021-04-08 13:33:41 +02:00
SomberNight
52be6a5453 lnrater: use network.asyncio_loop instead of asyncio.get_event_loop()
fixes #5376
2021-04-08 10:46:54 +02:00
ThomasV
f815f8eb30 Merge pull request #7178 from SomberNight/202104_kivy_freeze_addrs
kivy: implement freezing addresses
2021-04-07 17:24:38 +02:00
ThomasV
e936b6e4a5 fix #7185 2021-04-07 17:21:48 +02:00
SomberNight
c68d73715a android build: only build one apk for debug builds 2021-04-07 17:15:52 +02:00
SomberNight
dfc0f896b7 icons: clean up electrum svg icons
- change viewport to square, no cropping, add small margins
- rm invisible objects
2021-04-07 17:15:48 +02:00
ThomasV
1b763b4a3c add electrum svg icons 2021-04-06 19:04:17 +02:00
ThomasV
f7a8166b9c new icons for android 2021-04-06 18:57:30 +02:00
SomberNight
e5295701d2 wizard: let UserCancelled propagate out in hw wallet flow
Note that clicking "x" to close the wizard or pressing ESC also raises
a UserCancelled:
raising ChooseHwDeviceAgain was not letting the wizard close.

E | gui.qt.installwizard.InstallWizard |
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/base_wizard.py", line 371, in on_device
    client = self.plugin.setup_device(device_info, self, purpose)
  File "/home/user/wspace/electrum/electrum/plugins/trezor/trezor.py", line 305, in setup_device
    self.initialize_device(device_id, wizard, client.handler)
  File "/home/user/wspace/electrum/electrum/plugins/trezor/trezor.py", line 231, in initialize_device
    wizard.choice_dialog(title=_('Initialize Device'), message=msg, choices=choices, run_next=f)
  File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 106, in func_wrapper
    out = func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 614, in choice_dialog
    self.exec_layout(vbox, title)
  File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 434, in exec_layout
    raise UserCancelled()
electrum.util.UserCancelled

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/base_wizard.py", line 277, in choose_hw_device
    self._choose_hw_device(purpose=purpose, storage=storage)
  File "/home/user/wspace/electrum/electrum/base_wizard.py", line 363, in _choose_hw_device
    self.choice_dialog(title=title, message=msg, choices=choices,
  File "/home/user/wspace/electrum/electrum/gui/qt/installwizard.py", line 120, in func_wrapper
    run_next(*out)
  File "/home/user/wspace/electrum/electrum/base_wizard.py", line 364, in <lambda>
    run_next=lambda *args: self.on_device(*args, purpose=purpose, storage=storage))
  File "/home/user/wspace/electrum/electrum/base_wizard.py", line 386, in on_device
    raise ChooseHwDeviceAgain()
electrum.base_wizard.ChooseHwDeviceAgain
E | gui.qt.installwizard.InstallWizard | choose_hw_device(). while iter starts.
I | plugin.DeviceMgr | scanning devices...
2021-04-06 18:44:16 +02:00
SomberNight
c41cd4ae04 qt init: move Ctrl-C handling earlier 2021-04-06 18:27:28 +02:00
SomberNight
84ec734385 kivy: implement freezing addresses 2021-04-04 23:00:57 +02:00
SomberNight
94774c6ad2 lnutil: add rationale for MIN_FUNDING_SAT
related: https://github.com/spesmilo/electrum/issues/7169#issuecomment-812800652
2021-04-04 19:53:10 +02:00
SomberNight
c1cb2e67f6 qt channels dialog: handle funding tx missing
see https://github.com/spesmilo/electrum/issues/7175#issuecomment-813058152
2021-04-04 19:07:01 +02:00
ThomasV
7c0120e83a Merge pull request #7172 from verretor/2021-04-text
Show txid in text GUI
2021-04-04 07:52:53 +02:00
Benoit Verret
2fce31c5ec Show txid in text GUI 2021-04-03 23:59:11 -04:00
SomberNight
7102e79aa4 add missing release notes for old backports 2021-04-04 02:45:00 +02:00
SomberNight
349a033ce6 qt: fix some widget parenting issues
If you force-show a widget (e.g. `w.setVisible(True)`) before parenting it,
a small window will flash (appear and disappear) for a fraction of second,
which is a bit irritating.
2021-04-04 01:43:49 +02:00
SomberNight
1cd5235426 qt init: rm gui.close() method
There is gui.stop() already, which does the same thing (which is shared API with kivy).
Also, the _cleanup_before_exit() call was redundant in close(),
aboutToQuit handles that.
2021-04-04 01:05:23 +02:00
SomberNight
a3b16c7640 qt init: shutdown properly if last open window was a wizard
fixes #7171
2021-04-04 00:49:25 +02:00
SomberNight
981381346f qt: even more clean-up before exiting
related: https://github.com/spesmilo/electrum/issues/6889#issuecomment-812776695
2021-04-03 19:17:32 +02:00
ThomasV
e64aed2aec android backups: fix missing parameter 2021-04-03 14:28:36 +02:00
SomberNight
be43632cc4 qt init: more clean-up for system tray
related: https://github.com/spesmilo/electrum/issues/6889#issuecomment-812776695
2021-04-03 06:17:47 +02:00
SomberNight
14c5ceeacf qt init: (trivial) refactor system tray 2021-04-03 05:42:32 +02:00
SomberNight
d62a4833e5 lnpeer.channel_establishment_flow: check funding_sat in bounds earlier
closes #7169
2021-04-03 04:13:28 +02:00
SomberNight
e686b40819 qt init: don't catch BaseException unless there is good reason
let KeyboardInterrupt propagate out
2021-04-03 01:47:44 +02:00
SomberNight
34e64ef152 qt gui: some more clean-up when exiting
related: https://github.com/spesmilo/electrum/issues/6889

This fixes the case where the user quits by pressing Ctrl+C,
and some other minor things.

There is still another issue that sometimes causes a segfault during shutdown...
2021-04-03 01:44:42 +02:00
ThomasV
debe5cf03a release script: add hash comparison step before uploading 2021-04-02 18:24:12 +02:00
ThomasV
f249ccdfd7 prepare release 4.1.1 4.1.1 2021-04-02 17:33:37 +02:00
ThomasV
30d9e6a964 add contrib/release.sh script 2021-04-02 17:19:56 +02:00
ThomasV
039d11e350 Qt swap dialog: do not call update() from the asyncio thread. Fixes some segfaults that were triggered by opening the dialog 2021-04-02 15:33:37 +02:00
ThomasV
73482bb335 fix #7160 2021-04-02 15:07:08 +02:00
SomberNight
92226b077a qt tx dialog: handle fiat fee for zero-fee tx
fix #7166
2021-04-01 17:02:34 +02:00
ThomasV
774a9ad263 fix #7164 2021-04-01 14:42:52 +02:00
ThomasV
5b1d54d014 fix #7165 2021-04-01 14:25:39 +02:00
SomberNight
a2ed95340c locale/i18n: set language as early as possible
related: #7158
related: #4621
2021-04-01 04:36:02 +02:00