1
0
Commit Graph

16735 Commits

Author SHA1 Message Date
ThomasV
4e80ef818d Add unlock command to CLI (stores wallet password in memory) 2023-09-15 15:37:53 +02:00
Sander van Grieken
24f27618e2 qml: handle no wallet password for authed info 2023-09-15 11:42:49 +02:00
ThomasV
1e96bbc1e8 fix typo (follow-up previous commit) 2023-09-14 16:05:36 +02:00
ThomasV
d03c77837f Let the GUI compute the balance displayed in history.
Since Qt groups swap transactions, the displayed balance
was sometimes incorrect.
2023-09-14 15:58:58 +02:00
ThomasV
9df8bb61a5 Give users an option to cancel a submarine swap while awaiting HTLCs.
Note that HTLCs must not be cancelled after the funding transaction
has been broadcast. If one want to cancel a swap once the funding
transaction is in mempool, one should double spend the transaction.
2023-09-13 16:28:31 +02:00
Sander van Grieken
58dbe6690d qml: create ElCombBox and ElRadioButton that automatically word wrap their text element. Fixes #8611 2023-09-12 17:56:35 +02:00
SomberNight
139eb632d7 (trivial) follow-up paysession.use_two_trampolines arg change
follow-up b2053c68f1

- use_two_trampolines is already passed as arg to init
- strings in gui/messages.py should not end with a newline
2023-09-12 14:05:12 +00:00
SomberNight
6819f685d7 tests: add tests for "recv mpp confusion" bug
see https://github.com/spesmilo/electrum/security/advisories/GHSA-8r85-vp7r-hjxf
2023-09-12 13:58:57 +00:00
SomberNight
2746a9d93f lnchannel: replace assert htlc.payment_hash==sha256(preimage) w/ exc
asserts should not be used for security checks
2023-09-12 13:30:48 +00:00
SomberNight
9dff412017 release notes: add links to security disclosures 2023-09-12 12:37:50 +00:00
ThomasV
aade0e8ef9 disable option SEND_CHANGE_TO_LIGHTNING if we are already doing a swap 2023-09-11 10:46:37 +02:00
ThomasV
649ce979ab send tx change to lightning 2023-09-09 14:14:43 +02:00
ThomasV
f245b347f1 Merge pull request #8609 from SomberNight/202309_getconfig_default_value
getconfig/setconfig to use configvars
2023-09-08 19:06:25 +02:00
SomberNight
b3514672d6 run_electrum: small clean-up in init_cmdline 2023-09-08 15:46:06 +00:00
SomberNight
87f5df1e8b config: add sanity check for duplicate config keys 2023-09-08 15:11:59 +00:00
SomberNight
8c9fec4ab8 commands: getconfig to use default values, add existence checks
- getconfig and setconfig now both check configvars for existence
- getconfig returns default values when applicable
- setconfig does not side-step type-checks for values

fixes https://github.com/spesmilo/electrum/issues/8607
closes https://github.com/spesmilo/electrum/pull/8608
2023-09-08 15:11:55 +00:00
SomberNight
552bfb589a plugins: split load_plugins() 2023-09-08 14:48:36 +00:00
ThomasV
136978e9d0 submarine swaps: fail received HTLCs of normal swap htlcs if
the swap is still unfunded and the refund delay has expired.
2023-09-08 16:38:08 +02:00
SomberNight
b0e18d8f8e remove remnants of config SSL options
follow-up 012ce1c1bb
2023-09-08 11:34:34 +00:00
ThomasV
bee19d7dec remove dumpgraph and inject_fees from cli
Those commands were only used for testing.

inject_fees was particularly misleading, because an electrum
instance with an active network connection regularly updates
its fees, thus voiding the effecct of that command.
2023-09-08 11:53:41 +02:00
SomberNight
6a2806c2c5 simple_config: implement complex default values
Besides a literal value, the default can now also be a callable,
which gets called with the config and evaluated as needed, lazily.

This potentially allows e.g. the default value of one configvar to
depend on the current value of another configvar.
2023-09-07 15:30:46 +00:00
SomberNight
201309a7f0 ledger plugin: fix Ledger_Client.construct_new on very old btc app ver
related: https://github.com/spesmilo/electrum/issues/8568#issuecomment-1710162955
2023-09-07 14:47:55 +00:00
SomberNight
64ba3bd017 (trivial) do not use old-style (%) formatting inside translations
see f29cd810e3/electrum/i18n.py (L48)
2023-09-07 13:25:35 +00:00
SomberNight
f29cd810e3 commands: "bumpfee" to accept either a raw tx or a txid as its 1st arg
closes https://github.com/spesmilo/electrum/issues/8603
2023-09-07 13:18:23 +00:00
SomberNight
a560841f3f lnworker: fix some type hints re hold_invoices 2023-09-06 19:01:41 +00:00
ThomasV
a406f7bba0 lnpeer: return hold invoice callback after checking received amount 2023-09-06 20:59:32 +02:00
SomberNight
6468813105 swaps: fix type of payment_hash in init 2023-09-06 18:01:04 +00:00
SomberNight
5e8b14f742 logging: add config var "LOGS_NUM_FILES_KEEP" instead of hardcoded 10 2023-09-06 16:55:04 +00:00
SomberNight
43615487de follow-up prev 2023-09-06 16:24:11 +00:00
SomberNight
19718001e4 (trivial) CI: rename tasks 2023-09-06 16:21:18 +00:00
SomberNight
976f06f3c6 follow-up kivy removal: rm kivy/theming submodule
Looks like this was not fully removed.

$ git rm --force electrum/gui/kivy/theming/atlas

follow-up b45c84f24f
see https://github.com/spesmilo/electrum/pull/8591
2023-09-06 16:11:04 +00:00
SomberNight
c3562c00e6 tests: fix warnings in test_network.py
```
electrum/tests/test_network.py::TestNetwork::test_can_connect_during_backward
electrum/tests/test_network.py::TestNetwork::test_chain_false_during_binary
electrum/tests/test_network.py::TestNetwork::test_fork_conflict
electrum/tests/test_network.py::TestNetwork::test_fork_noconflict
  /tmp/cirrus-ci-build/electrum/interface.py:410: RuntimeWarning: coroutine 'Interface.run' was never awaited
    task = await self.network.taskgroup.spawn(self.run())
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
```

closes https://github.com/spesmilo/electrum/pull/7817
2023-09-06 15:53:40 +00:00
SomberNight
dd3966070d tests: rm some redundant "electrum_path" temp dirs 2023-09-06 14:12:30 +00:00
SomberNight
4f90632b1d tests: fix warnings in test_storage_upgrade.py
Manage global event loop so that it is accessible to threads
other than the asyncio thread. In particular, the Plugins
thread needs to reference it in its on_stop().
2023-09-06 14:12:26 +00:00
SomberNight
2529323ba3 (trivial) lnworker: fix type hint 2023-09-06 14:11:41 +00:00
SomberNight
1dd4acce9c Merge branch '202308_rm_kivy'
(PR https://github.com/spesmilo/electrum/pull/8591)
2023-09-06 13:35:57 +00:00
ThomasV
af27d5b95e Payment bundles: use lists of payment keys.
That way we don't need to special case trampoline outer onions
2023-09-06 10:44:55 +02:00
ThomasV
04c2129685 follow-up prev commit; do not return tw-info if forwarding is disabled 2023-09-06 10:35:31 +02:00
ThomasV
0e43ef2792 lnpeer: return fw_info for all parts of a MPP in a trampoline onion
Due to an indendation error, fw_info was returned only for one
HTLC of the MPP. Thus, maybe_fulfill_htlc was called again with
the remaining HTLCs, which could possibly be failed due to MPP
timeout, resulting in fund loss for the forwarder.
2023-09-06 09:51:07 +02:00
SomberNight
f28a2824d5 qt: do not show UntrustedServerReturnedError when sweeping
We should not show the untrusted text in the GUI...
With this change, we still log the text, but otherwise it should avoid
unintentionally showing it anywhere, as the original exception is
masked away.

related: https://github.com/spesmilo/electrum/issues/8599#issuecomment-1706775508

Example traceback (and the exc is then shown in main_window.on_error):
```
 10.77 | D | n/network | got error from server for Network.listunspent_for_scripthash: <UntrustedServerReturnedError [DO NOT TRUST THIS MESSAGE] original_exception: "RPCError(0, 'heyheyhey')">
 10.78 | E | gui.qt.main_window.[test_segwit_2] | on_error
Traceback (most recent call last):
  File "...\electrum\electrum\network.py", line 898, in wrapper
    return await func(self, *args, **kwargs)
  File "...\electrum\electrum\network.py", line 1149, in listunspent_for_scripthash
    return await self.interface.listunspent_for_scripthash(sh)
  File "...\electrum\electrum\interface.py", line 1027, in listunspent_for_scripthash
    raise aiorpcx.jsonrpc.RPCError(0, "heyheyhey")
aiorpcx.jsonrpc.RPCError: (0, 'heyheyhey')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\util.py", line 925, in run
    result = task.task()
  File "...\electrum\electrum\gui\qt\main_window.py", line 2505, in <lambda>
    task = lambda: self.network.run_from_another_thread(
  File "...\electrum\electrum\network.py", line 383, in run_from_another_thread
    return fut.result(timeout)
  File "...\Python310\lib\concurrent\futures\_base.py", line 458, in result
    return self.__get_result()
  File "...\Python310\lib\concurrent\futures\_base.py", line 403, in __get_result
    raise self._exception
  File "...\electrum\electrum\wallet.py", line 151, in sweep_preparations
    async with OldTaskGroup() as group:
  File "...\aiorpcX\aiorpcx\curio.py", line 304, in __aexit__
    await self.join()
  File "...\electrum\electrum\util.py", line 1316, in join
    task.result()
  File "...\electrum\electrum\wallet.py", line 142, in find_utxos_for_privkey
    await _append_utxos_to_inputs(
  File "...\electrum\electrum\wallet.py", line 129, in _append_utxos_to_inputs
    u = await network.listunspent_for_scripthash(scripthash)
  File "...\electrum\electrum\network.py", line 872, in make_reliable_wrapper
    async with OldTaskGroup(wait=any) as group:
  File "...\aiorpcX\aiorpcx\curio.py", line 304, in __aexit__
    await self.join()
  File "...\electrum\electrum\util.py", line 1327, in join
    self.completed.result()
  File "...\electrum\electrum\network.py", line 903, in wrapper
    raise wrapped_exc from e
electrum.network.UntrustedServerReturnedError: The server returned an error.
```
2023-09-05 15:47:33 +00:00
sorenstoutner
ddad5f1320 Fix Revealer Qt layout (#8587)
* Fix Revealer Qt layout

* Add license information
2023-09-05 12:32:38 +00:00
Sander van Grieken
307cf25fd4 register distinction between address and script for SPK type payment identifiers and allow zero amount for
script destinations.

This is mainly to support OP_RETURN outputs, which typically have a zero amount output value,
but as we don't special case OP_RETURN, this is currently done for all non-address scripts

Also, it's probably good to add a warning popup for OP_RETURN outputs with a non-zero output value, but this
would also need special casing for OP_RETURN.

Saving of script output payment identifiers is disabled for now, as reading the script from the stored invoice
back into human-readable form is currently not implemented, and currently only lightning invoices or address output
is supported.
2023-09-04 20:00:40 +02:00
Sander van Grieken
0d96bc1dbd qt/send_tab: fix regressions paymentidentifier
Fix '!' amount expand while PaymentIdentifier not set due to editor pushback timer.
Fix '!' amount expand for BIP21 without a specified payment amount.
2023-09-04 15:55:23 +02:00
Sander van Grieken
a52c715304 qml: show experimental warning before opening first lightning channel. closes #8564 2023-09-04 15:02:40 +02:00
Sander van Grieken
a740a20fc2 qml: pass the invoice/invoiceparser to payOnchain 2023-09-01 15:44:24 +02:00
Sander van Grieken
c348d4d7ce follow-up 0a804607a4, don't ask confirmation for regular onchain invoices 2023-09-01 15:08:01 +02:00
Sander van Grieken
0a804607a4 qml: properly suggest paying bolt11 invoice onchain if insufficient LN balance.
Also, if fallback address is present, don't warn on bolt11 and no ln channels.
2023-09-01 15:03:44 +02:00
ThomasV
a5da379d13 swap dialog: show on_result popup for both directions 2023-09-01 08:47:55 +02:00
ThomasV
b5654b640a Merge pull request #8590 from SomberNight/202308_debug_threading_issues
add stacktracer.py: helper util to debug threading issues
2023-08-31 14:46:08 +02:00
ThomasV
e80310eb32 lnpeer: trampoline forwarding failures may be indexed by outer or inner onion payment secret 2023-08-31 05:55:28 +02:00