Commit Graph

4320 Commits

Author SHA1 Message Date
ghost43
e7c7a2a834 Merge pull request #7308 from bitromortac/2105-fix-cmd-reverse-swap
swaps: fix satoshi conversion bug
2021-06-05 05:35:46 +00:00
SomberNight
cd50472b18 kivy: (fix) forbid creating LN payreq if LN is disabled for wallet
fix #6346

see https://github.com/spesmilo/electrum/issues/6346#issuecomment-854655931
2021-06-04 14:11:19 +02:00
bitromortac
3c02f6b922 swaps: fix satoshi conversion bug 2021-05-19 07:27:54 +02:00
SomberNight
cad4e77853 fix prev 2021-05-15 06:57:59 +02:00
SomberNight
b2169b745e wallet: (fix) "batch_rbf" must not mutate LN funding txs
The "Batch RBF transactions" feature mutates existing "local" and "unconfirmed RBF"
transactions when creating new transactions: it simply adds the new outputs to the
existing txs (and updates the change).
The "RBF" flag is only enforced for unconfirmed txs, not for local txs.
The bug was that given a local LN funding tx, when creating a new channel
with "batch_rbf" enabled, we would modify the existing local tx, and
broadcast that.

related: #7298
2021-05-15 06:31:03 +02:00
SomberNight
9c1a51547a kivy: (trivial) clean-up imports in screens.py 2021-05-06 18:19:55 +02:00
SomberNight
3b0209a3a5 follow-up prev 2021-05-06 18:18:52 +02:00
bitromortac
853e912885 invoice: fail gracefully with large amount 2021-05-06 15:37:17 +02:00
bitromortac
6ce96306ca util: check bip21 url for amount 2021-05-06 15:37:17 +02:00
SomberNight
ef3293ab6a kivy: relocate atlas so it can be made a submodule later 2021-04-30 16:44:32 +02:00
jpph
0a56404f28 bip39 auto import, add coolwallet S weird derivation path (#7261)
auto import, add coolwallet S weird derivation path #7259

Would be nice to auto detect also coolwallet S derivation path.
In file bip39_wallet_formats.json :
{ "description": "coolwallet S derivation path using bip44 but with segwit script format",
"derivation_path": "m/44'/0'/0'",
"script_type": "p2wpkh-p2sh",
"iterate_accounts": true
}
see https://help.coolwallet.io/article/160-recover-btc-using-coolwallet-s-seed-without-the-wallet for their recovery instruction
2021-04-30 13:13:01 +00:00
bitromortac
97b31880d7 kivy: improve openchannel dialog for trampoline 2021-04-30 13:32:07 +02:00
ghost43
de716ab07c Merge pull request #7247 from bitromortac/2104-fix-liquidity-hints
lnworker: fix path_finder access
2021-04-26 15:17:40 +00:00
SomberNight
8bba3b9ef5 network: also clear network.path_finder in stop_gossip
stop_gossip should undo start_gossip

related: #7242
2021-04-26 17:06:52 +02:00
ThomasV
04b1e8718a tx dialog (Qt): if possible, save psbt and fully signed transaction under the same basename. 2021-04-26 12:31:04 +02:00
bitromortac
4cb0b99996 lnworker: fix path_finder access 2021-04-26 08:43:50 +02:00
SomberNight
86ba37dc1c qt send tab: when clicking "Max", show tooltip explaining max amt
Beginner users often ask why they cannot send their full balance.
Hence, this intends to reduce support load.
In terms of UI, maybe there is a better way to do this but this was
easy to do and still a good first step IMHO.
2021-04-23 17:52:19 +02:00
SomberNight
37bde9baf9 qt: cpfp: fix handling "no dynamic fee estimates"
fixes #7237
2021-04-23 17:27:00 +02:00
ghost43
ecb083b283 Merge pull request #7231 from bitromortac/2104-fix-swap-check
swaps: fix swap sanity check
2021-04-23 12:57:44 +00:00
bitromortac
b97e51dbd8 swaps: fix off-by-one sanity check
Tolerates discrepancies in the swap amount crosschecks. To ensure we
calculate the send/receive amounts correctly we apply a check, using
amount inversion. The inversion is not exact up to +-1 due to used
floor and ceil functions in the methods. They are not invertible,
which is why we relax the check to off-by-ones.
2021-04-23 07:43:36 +02:00
SomberNight
1436760d3d qt coins tab: Ctrl+F now searches the whole prevout string
(not just the truncated string that is displayed in the list)
2021-04-22 20:56:00 +02:00
SomberNight
3b77340671 Qt MyTreeView: rm usages of Qt.UserRole, use explicit roles instead
This is a bit more verbose but it explicitly shows what data is being
used where.

Also rm implicitly setting editable_columns based on stretch_column.
2021-04-22 20:37:14 +02:00
SomberNight
720d60c391 (trivial) rm dead code
follow-up #7152
2021-04-22 17:57:50 +02:00
SomberNight
af44c846cc tests: add test for payto command 2021-04-22 17:13:56 +02:00
ghost43
0f83270053 Merge pull request #7152 from bitromortac/2103-liquidity-hints
Liquidity hints for pathfinding
2021-04-22 14:45:41 +00:00
ThomasV
8ce94248d4 kivy: update wizard message: pin->password 2021-04-21 10:33:11 +02:00
SomberNight
11bb39ee82 kivy: implement freezing channels 2021-04-19 18:57:47 +02:00
SomberNight
4e0a20ae46 gui messages: mv one more message to messages.py 2021-04-19 18:57:43 +02:00
SomberNight
0ab9687734 kivy: make ActionDropdown disappear when an action is selected 2021-04-19 18:57:39 +02:00
SomberNight
e15a11a437 kivy: use ActionDropdown in ChannelDetailsPopup 2021-04-19 18:04:15 +02:00
SomberNight
b8ec85d615 kivy tx dialog: abstract away ActionDropdown, mv into its own file 2021-04-19 18:01:22 +02:00
SomberNight
b27925c6c5 kivy tx dialog: dscancel btn text was too long
see first part of #6868
2021-04-19 16:40:57 +02:00
SomberNight
4f6c0c2c61 kivy bump fee dialog: handle no dynamic fee estimates
fix #7220
2021-04-19 16:06:43 +02:00
ThomasV
8f95dc2640 Merge pull request #7211 from SomberNight/202104_keep_early_logs
logging: don't lose log messages during early startup
2021-04-18 20:56:24 +02:00
Benoit Verret
2cc16f8ed4 Avoid hiding QR codes with help_text
In some situations, if a QR code's data and help_text were too long,
the QR code was unscannable.
2021-04-17 22:54:37 -04:00
ThomasV
75d77c55d6 commands, input sanitization: allow 'max' amounts only in specific contexts (payto, paytomany) 2021-04-16 16:03:25 +02:00
SomberNight
7ffb2c3cb0 config: (trivial) add some type hints and rm unused variable 2021-04-15 19:00:46 +02:00
SomberNight
f53f177203 kivy swaps: handle no dynamic fee estimates
fixes #7215
2021-04-15 18:50:54 +02:00
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
bitromortac
5e03d751eb lnrouter: add hint timestamp 2021-04-09 11:11:22 +02:00
bitromortac
bc20f57a78 lnrouter: remove blacklist boolean 2021-04-09 11:11:21 +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
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 2021-04-08 15:22:40 +02:00
ThomasV
2c39f0c9c4 fix #7190 2021-04-08 15:12:32 +02:00
SomberNight
0ee9442972 qt update notifications: add another key for redundancy 2021-04-08 14:39:36 +02:00