1
0
Commit Graph

15433 Commits

Author SHA1 Message Date
sorenstoutner
7cff34b971 Add an AppStream metainfo.xml file
AppStream metainfo.xml files are like extended .desktop files used to populate app stores with information about GUI applications.  Debian and Ubunto and other major Linux distributions are starting to push for their inclusions.  This is a fairly minimal example that just covers the required entries.  The text for the description is a slightly modified version of text taken from Electrum's FAQ.

Metainfo files can contain links to screenshots.  I have not included any here, but that might be something someone would like to add in the future.
2023-01-14 15:09:37 -07:00
ThomasV
8fa549c418 Merge pull request #8135 from spesmilo/scid_alias
Add support for option_scid_alias
2023-01-13 18:44:13 +01:00
ThomasV
7bfcf4f4d8 Merge pull request #8143 from MrNaif2018/tx-hashes-unpaid-invoices
Return list of tx hashes for partially paid invoices too
2023-01-13 18:29:58 +01:00
Sander van Grieken
77c64b6629 fix wizard leftovers of removed 'multisig_show_masterpubkey' view 2023-01-13 17:25:12 +01:00
ThomasV
e74857f1ce lnmsg: remove handling of optional fields in msgdata 2023-01-13 16:11:11 +01:00
ThomasV
7d52021d6b Merge pull request #8139 from SomberNight/202301_locale_decimal_point
locale amounts: consistently use "." as dec point, and " " as thou sep
2023-01-13 16:00:47 +01:00
ThomasV
b9393b0603 Support scid alias:
- save remote alias for use in invoices
 - derive local alias from wallet xpub
 - send channel_type without the option_scid_alias bit
   (apparently LND does not like it)
2023-01-13 15:47:30 +01:00
ThomasV
89df68d66a channel_db: protect load_db against raw messages that can no longer be parsed 2023-01-13 15:47:02 +01:00
ThomasV
020637b5d4 fix field type: 'varint' was rebńamed to 'bigsize' 2023-01-13 15:45:20 +01:00
ThomasV
c109d5e722 lnwire: update csv files with recent BOLTs
Note: there are no more optional fields in msgdata, per f068dd0d8d
2023-01-13 12:50:48 +01:00
ThomasV
d95f3e5622 Use different trampoline bits than Eclair. Fixes #8141 2023-01-13 12:48:13 +01:00
Sander van Grieken
ddfe1a6d70 qml: add lightning network status indicator in top bar, add channel peers to NetworkOverview 2023-01-13 12:36:33 +01:00
Sander van Grieken
c94d3529f5 qml: serverlistmodel use network is tor flag for server list filter 2023-01-13 12:36:33 +01:00
SomberNight
762a9a9e7a follow-up prev: fix tests 2023-01-13 10:55:52 +00:00
SomberNight
ab953f4a7f lnmsg: add details to FailedToParseMsg, log message type
note: Would it be ok to log potentially secret (semi-sensitive) data?
We take care not to log onchain private keys as they are extremely sensitive,
but what about logging a LN transport message that might contain channel secrets?
Decided not to, for now.
2023-01-13 10:37:06 +00:00
Sander van Grieken
4c229fdf08 qml: SendDialog icon 2023-01-13 11:13:56 +01:00
Sander van Grieken
7cc344dbc9 qml: show Tor status in NetworkOverview 2023-01-13 11:13:56 +01:00
Sander van Grieken
f33989b445 immediately check for Tor upon proxy set 2023-01-13 11:13:56 +01:00
Sander van Grieken
d26440b964 qml: refactor proxy options to map, remove explicit TOR option 2023-01-13 11:13:56 +01:00
ThomasV
d70a574780 Increase trampoline fee if we receive TEMPORARY_CHANNEL_FAILURE
Sometimes the trampoline node fails to send a payment and returns
TEMPORARY_CHANNEL_FAILURE, while it succeeds with a higher trampoline
fee. My guess is that the initial fee was not sufficient to try
all routes, and that a higher fee allows to use extra routes. I
suppose it would make more sense if the trampoline node returned
TRAMPOLINE_FEE_INSUFFICIENT in that case.
2023-01-13 11:02:19 +01:00
SomberNight
d5c3c7ca66 payserver: daemon._run should only be called once 2023-01-13 01:02:47 +00:00
SomberNight
9039ec1dc4 payserver: make daemon_wallet_loaded hook reliable
daemon.load_wallet() often early-returns,
e.g. in Qt case, for storage-encrypted wallets.

closes https://github.com/spesmilo/electrum/issues/8118
2023-01-13 00:58:02 +00:00
MrNaif2018
c785eb9ccd Return list of tx hashes for partially paid invoices too 2023-01-13 01:04:49 +03:00
SomberNight
9a0fff2571 wallet.get_request_by_addr: make deterministic
This makes test_invoices/test_wallet_get_request_by_addr pass without flakyness.

closes https://github.com/spesmilo/electrum/issues/8113
2023-01-12 18:19:11 +00:00
SomberNight
7dcaa4b204 tests: add tests for wallet/invoices functionality
only for payment requests ("incoming invoices") for now
2023-01-12 18:19:08 +00:00
SomberNight
8829b7cd63 wallet: fix deadlock in on_event_adb_added_verified_tx
wallet.lock -> wallet.transaction_lock order must be respected.

deadlock example:
```
# ThreadID: 19100
File: ...\Python\Python310\lib\threading.py", line 966, in _bootstrap
  self._bootstrap_inner()
File: ...\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
  self.run()
File: ...\Python\Python310\lib\threading.py", line 946, in run
  self._target(*self._args, **self._kwargs)
File: "...\electrum\electrum\util.py", line 1552, in run_event_loop
  loop.run_until_complete(stopping_fut)
File: ...\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
  self.run_forever()
File: ...\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
  super().run_forever()
File: ...\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
  self._run_once()
File: ...\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
  handle._run()
File: ...\Python\Python310\lib\asyncio\events.py", line 80, in _run
  self._context.run(self._callback, *self._args)
File: "...\electrum\electrum\wallet.py", line 494, in on_event_adb_added_verified_tx
  self._update_invoices_and_reqs_touched_by_tx(tx_hash)
File: "...\electrum\electrum\wallet.py", line 2454, in _update_invoices_and_reqs_touched_by_tx
  status = self.get_invoice_status(request)
File: "...\electrum\electrum\wallet.py", line 2333, in get_invoice_status
  paid, conf = self.is_onchain_invoice_paid(invoice)
File: "...\electrum\electrum\wallet.py", line 1120, in is_onchain_invoice_paid
  is_paid, conf_needed, relevant_txs = self._is_onchain_invoice_paid(invoice)
File: "...\electrum\electrum\wallet.py", line 1095, in _is_onchain_invoice_paid
  with self.lock, self.transaction_lock:
File: "...\electrum\electrum\address_synchronizer.py", line 70, in acquire
  return self._lock.acquire(*args, **kwargs)

# ThreadID: 20040
File: "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pycharm\_jb_pytest_runner.py", line 51, in <module>
  sys.exit(pytest.main(args, plugins_to_load + [Plugin]))
File: "...\Python\Python310\site-packages\_pytest\config\__init__.py", line 164, in main
  ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File: ...\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
  return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
  return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
  res = hook_impl.function(*args)
File: "...\Python\Python310\site-packages\_pytest\main.py", line 315, in pytest_cmdline_main
  return wrap_session(config, _main)
File: "...\Python\Python310\site-packages\_pytest\main.py", line 268, in wrap_session
  session.exitstatus = doit(config, session) or 0
File: "...\Python\Python310\site-packages\_pytest\main.py", line 322, in _main
  config.hook.pytest_runtestloop(session=session)
File: ...\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
  return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
  return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
  res = hook_impl.function(*args)
File: "...\Python\Python310\site-packages\_pytest\main.py", line 347, in pytest_runtestloop
  item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File: ...\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
  return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
  return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
  res = hook_impl.function(*args)
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 111, in pytest_runtest_protocol
  runtestprotocol(item, nextitem=nextitem)
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 130, in runtestprotocol
  reports.append(call_and_report(item, "call", log))
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 219, in call_and_report
  call = call_runtest_hook(item, when, **kwds)
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 258, in call_runtest_hook
  return CallInfo.from_call(
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 338, in from_call
  result: Optional[TResult] = func()
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 259, in <lambda>
  lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File: ...\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
  return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
  return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File: ...\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
  res = hook_impl.function(*args)
File: "...\Python\Python310\site-packages\_pytest\runner.py", line 166, in pytest_runtest_call
  item.runtest()
File: "...\Python\Python310\site-packages\_pytest\unittest.py", line 327, in runtest
  self._testcase(result=self)  # type: ignore[arg-type]
File: ...\Python\Python310\lib\unittest\case.py", line 650, in __call__
  return self.run(*args, **kwds)
File: ...\Python\Python310\lib\unittest\case.py", line 591, in run
  self._callTestMethod(testMethod)
File: ...\Python\Python310\lib\unittest\case.py", line 549, in _callTestMethod
  method()
File: "...\electrum\electrum\tests\test_invoices.py", line 120, in test_wallet_without_ln_creates_payreq_and_gets_paid_onchain
  self.assertEqual(PR_PAID, wallet1.get_invoice_status(pr))
File: "...\electrum\electrum\wallet.py", line 2333, in get_invoice_status
  paid, conf = self.is_onchain_invoice_paid(invoice)
File: "...\electrum\electrum\wallet.py", line 1120, in is_onchain_invoice_paid
  is_paid, conf_needed, relevant_txs = self._is_onchain_invoice_paid(invoice)
File: "...\electrum\electrum\wallet.py", line 1095, in _is_onchain_invoice_paid
  with self.lock, self.transaction_lock:
File: "...\electrum\electrum\address_synchronizer.py", line 70, in acquire
  return self._lock.acquire(*args, **kwargs)
```
2023-01-12 18:19:04 +00:00
SomberNight
f3102af195 util: create_and_start_event_loop() to wait until loop starts
With a PyCharm debugger attached, sometimes the python process is so
CPU-starved for me that create_and_start_event_loop() returned
before the event loop actually started, resulting in weird errors.
I guess this could happen even without a debugger attached on a
sufficiently slow CPU.

```
...\electrum\electrum\wallet.py:3580: in restore_wallet_from_text
    wallet = Wallet(db, storage, config=config)
...\electrum\electrum\wallet.py:3501: in __new__
    wallet = WalletClass(db, storage, config=config)
...\electrum\electrum\wallet.py:3345: in __init__
    Deterministic_Wallet.__init__(self, db, storage, config=config)
...\electrum\electrum\wallet.py:3135: in __init__
    self.synchronize()
...\electrum\electrum\wallet.py:3283: in synchronize
    count += self.synchronize_sequence(False)
...\electrum\electrum\wallet.py:3267: in synchronize_sequence
    self.create_new_address(for_change)
...\electrum\electrum\wallet.py:3254: in create_new_address
    self.adb.add_address(address)
...\electrum\electrum\address_synchronizer.py:213: in add_address
    self.up_to_date_changed()
...\electrum\electrum\address_synchronizer.py:680: in up_to_date_changed
    util.trigger_callback('adb_set_up_to_date', self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <electrum.util.CallbackManager object at 0x000002B1788AD6F0>
event = 'adb_set_up_to_date'
args = (<electrum.address_synchronizer.AddressSynchronizer object at 0x000002B17A687670>,)

    def trigger_callback(self, event, *args):
        """Trigger a callback with given arguments.
        Can be called from any thread. The callback itself will get scheduled
        on the event loop.
        """
        if self.asyncio_loop is None:
            self.asyncio_loop = get_asyncio_loop()
>           assert self.asyncio_loop.is_running(), "event loop not running"
E           AssertionError: event loop not running

...\electrum\electrum\util.py:1734: AssertionError
```
2023-01-12 18:19:00 +00:00
SomberNight
98bf974319 invoices: fix to_debug_json: LN r_tags might be missing
>           'r_tags': [ str((a.hex(),b.hex(),c,d,e)) for a,b,c,d,e in self._lnaddr.get_routing_info('r')[-1]]
        })
E       IndexError: list index out of range
2023-01-12 18:18:56 +00:00
Sander van Grieken
0bc8460005 qml: don't initialize instance variables on class scope for non-singletons
(this somehow escaped attention before, as most objects usually don't have multiple instances,
unless multiple wallets are open at the same time.)
Also, move all signal declarations, class constants and variables to the top of class definitions.
2023-01-12 13:09:21 +01:00
Sander van Grieken
58d25d4a5d qml: flake8 happifier 2023-01-10 17:32:20 +01:00
Sander van Grieken
78020e5cc9 qml: Only enable Invoices menu option when there is a wallet opened 2023-01-10 17:28:33 +01:00
Sander van Grieken
bc91732f22 qml: crash handler, move Exception_Hook to qeapp.py 2023-01-10 17:17:19 +01:00
Sander van Grieken
fa030b3fa5 qml: initial crash handler impl 2023-01-10 17:02:38 +01:00
Sander van Grieken
85718bda89 qml add richText property to MessageDialog.
TODO: now we need to handle clicks on link too
2023-01-10 17:02:38 +01:00
SomberNight
2a9909c252 locale amounts: consistently use "." as dec point, and " " as thou sep
Always use "." as decimal point, and " " as thousands separator.

Previously,
- for decimal point, we were using
  - "." in some places (e.g. AmountEdit, most fiat amounts), and
  - `locale.localeconv()['decimal_point']` in others.
- for thousands separator, we were using
  - "," in some places (most fiat amounts), and
  - " " in others (format_satoshis)

I think it is better to be consistent even if whatever we pick differs from the locale.
Using whitespace for thousands separator (vs comma) is probably less confusing for people
whose locale would user "." for ts and "," for dp (as in e.g. German).

The alternative option would be to always use the locale. Even if we decide to do that later,
this refactoring should be useful.

closes https://github.com/spesmilo/electrum/issues/2629
2023-01-10 14:45:35 +00:00
SomberNight
b0e2e89395 i18n: document not to use old-style (%) string formatting 2023-01-10 14:06:29 +00:00
ThomasV
63d801e363 Merge pull request #8136 from myxmaster/update-status-bar
Update status bar when preference "Zeros after decimal point" is changed
2023-01-10 14:30:36 +01:00
ThomasV
380b69e5b1 Merge pull request #8132 from myxmaster/space-between-piechart-and-balance
Space between pie chart and balance fix
2023-01-10 14:11:41 +01:00
myxmaster
e6cdcf7413 update status bar when setting "zeros after decimal point" is changed 2023-01-10 13:51:21 +01:00
ThomasV
d7dee45ee9 CLI: decode_invoice: show the last hop of routing hints 2023-01-10 11:57:59 +01:00
myxmaster
7dbf046b03 Space between pie chart and balance fix 2023-01-09 23:46:45 +01:00
Sander van Grieken
10e7d8d926 qml: styling main view 2023-01-09 18:17:17 +01:00
Sander van Grieken
32d60be90a qml: styling OpenWalletDialog 2023-01-09 18:17:17 +01:00
ThomasV
ca544518a8 Merge pull request #8130 from myxmaster/use-placeholder-for-better-translation
use placeholder for better translation
2023-01-09 17:56:39 +01:00
Sander van Grieken
34d483b365 qml: fix invoice amount editable when expired 2023-01-09 17:44:07 +01:00
Sander van Grieken
be371c8d88 qml: styling TxDetails 2023-01-09 17:38:07 +01:00
Sander van Grieken
f7ac768744 qml: messagedialog No now maps to rejected signal 2023-01-09 17:37:23 +01:00
Sander van Grieken
82458e7cf0 qml: use FormattedAmount in LightningPaymentDetails, formatter and fx now use millisats if available, else sats 2023-01-09 17:36:12 +01:00
myxmaster
4a0e337c6d use placeholder for better translation 2023-01-09 17:28:19 +01:00
Sander van Grieken
4071fe9726 qml: fix prev 2023-01-09 12:51:50 +01:00