1
0
Commit Graph

18928 Commits

Author SHA1 Message Date
ghost43
cd5e6559b6 Merge pull request #9983 from f321x/change_android_qr_lib
android: replace qr code scanning library
2025-07-04 13:02:46 +00:00
ghost43
ce90d8f01b Merge pull request #9862 from oren-z0/fix-timelock-recovery-watch-wallets
Fix Timelock Recovery plugin for watch wallets
2025-07-04 06:29:13 +00:00
Oren
afc62ebb77 Ok to press Sign and not save as a file
It's ok to click the View button, then
press Sign, and then close the window

the signed transaction will be used
by the on_closed callback
2025-07-03 15:50:12 +03:00
Oren
53b3c1de3e control prompt_if_unsaved
In the current logic, even if
prompt_if_unsaved was False,
the prompt will appear if the signing
is complete (and unsaved).
2025-07-03 15:50:12 +03:00
Oren
951ca76fc2 allow signing transaction from View 2025-07-03 15:50:12 +03:00
Oren
fb40bbe96b keep the same locktime
We don't want the txid to change because
the new transaction has a new random locktime.
2025-07-03 15:50:12 +03:00
Oren
2e96886960 labels to show signed txes 2025-07-03 15:50:12 +03:00
Oren
fb535516d3 Rename labels to fee labels 2025-07-03 15:50:12 +03:00
Oren
78c0425931 return tx in on_closed callback 2025-07-03 15:50:12 +03:00
Oren
7eb29f9a6b watch-only wallets should sign externally
The Next button should be clicked
only after the transactions have been signed
2025-07-03 15:50:12 +03:00
Oren
d1a15ae8f6 throw exception if signing is not complete
There could be flows where sign_transaction
will return without actually
signing the transaction.

We also want to add the ability to sign
the transactions externally, so here we check
if they are already signed.
2025-07-03 15:50:12 +03:00
Oren
ac38b4a594 don't use config FEE_POLICY
Long Term recovery transactions should have
a high fee policy, because we don't know when
we will broadcast them.

On the other hand, they won't need to be urgent
when broadcasted either.
2025-07-03 15:50:12 +03:00
ghost43
55c7c6c4df Merge pull request #9999 from nabijaczleweli/Sortorder
history: fix displayed STATUS sort order
2025-07-02 00:10:45 +00:00
наб
2e68d25187 history: fix displayed STATUS sort order
Ref: #9969
Ref: #9999
2025-07-01 23:33:09 +02:00
SomberNight
38f83940a0 qt gui: history: fix 'txpos_in_block' for mempool/local txs
follow-up https://github.com/spesmilo/electrum/pull/9967
2025-07-01 02:15:21 +00:00
ghost43
e59b84ad1e Merge pull request #9968 from nabijaczleweli/shid
Pre-compute sort keys, don't launder getting them through get_data_for_role()
2025-07-01 02:13:07 +00:00
наб
1ae2503014 custom_model: open-code QtCore.QAbstractItemModel.hasIndex()
The implementation is just
	bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent) const
	{
	    if (row < 0 || column < 0)
	        return false;
	    return row < rowCount(parent) && column < columnCount(parent);
	}
and yet it features as the most prominent part of the profile,
encompassing up to 25% of refresh()

Open-coding it makes refresh() 40% faster. Measurements from between
after wallet.get_full_history() and return from refresh()

Before:
	1.8637257907539606
	1.8563996930606663
	1.7696567592211068
	1.8933695629239082

After:
	1.3133591176010668
	1.3686819169670343
	1.2470976510085166
	1.2455544411204755
2025-07-01 03:32:43 +02:00
наб
5b39e305f6 history_list: if transactions == self.transactions can never hold
We add ['balance'] to all root entries, this never holds even if the
transaction sets themselves are the same
2025-07-01 03:32:43 +02:00
наб
8da694c9c3 history_list: pre-compute sort keys, don't launder getting them through get_data_for_role()
endInsertRows() triggers a sort, the history sort/filter proxy model
then launders the comparison requests through get_data_for_role()
with a custom key, which is then especially looked up in there,
but custom-flattened in the proxy model. This is OO hell

Measuring refresh() from after if transactions == self.transactions: return
to the final return, sorting the wallet from #9958/#6625 takes ~3.5s
and 132348 get_data_for_role() calls

Beside that get_data_for_role() is called maybe 10 times per on-hover?
It's immaterial

Thus: compute the sorting keys when constructing the HistoryNode
and use them directly in the comparison.
This decouples get_data_for_role() from the sorter
and speeds the sort up by ~2x,
now being mostly made up of the python interpreter overhead(?)
for upcalls to lessThan()

A dict wins with a list for the lookup a tiny bit
(and is 100x better code-wise):

1.896097298245877s list
1.840533264912665s list
1.757185084745288s list
1.8990754359401762s list
1.914668960031122s list
1.9349112827330828s list
2.432649422902614s list
1.929884395096451s list
1.9610795709304512s list
1.8694845158606768s list
1.9600030612200499s list
1.9199693519622087s dict
2.0466488380916417s dict
1.8510140180587769s dict
1.8978681536391377s dict
2.0079748439602554s dict
1.9111531740054488s dict
1.9525738609954715s dict
1.850804285146296s dict
1.860573346260935s dict
1.95173170696944s dict
1.8481200002133846s dict

Benchmark 1: dict
  Time (mean ± σ):       1918.039234 ms ±    63.688609 ms
  Range (min … max):     1848.120000 ms …  2046.648838 ms    11 runs

Benchmark 2: list
  Time (mean ± σ):       1945.052027 ms ±   164.019588 ms
  Range (min … max):     1757.185085 ms …  2432.649423 ms    11 runs

Summary
  'dict' ran
    1.014084 ± 0.090082 times faster than 'list'
2025-07-01 03:32:42 +02:00
SomberNight
61623d6d56 daemon lockfile: if create_time is in the future, don't wait for it :D
- if Electrum cannot do a graceful shutdown, the daemon lockfile won't get cleaned up
- the daemon lockfile contains the creation time of the daemon
- then, especially for an always offline phone/laptop, if the battery dies, the clock
  might go back to the past
- the bug: next time Electrum starts, the program will wait until create_time + 1.0
  before giving up on the daemon and creating a new one

closes https://github.com/spesmilo/electrum/issues/9802
  - certainly fixes at least https://github.com/spesmilo/electrum/issues/9802#issuecomment-3020220593
  - the OP there might or might not be the same issue
closes https://github.com/spesmilo/electrum/issues/9529
  - same here, might or might not be the same issue

the logic bug is quite old, from e6020975a5
2025-06-30 22:36:49 +00:00
f321x
10b75ebed7 android: build BarcodeScannerView from src
Adds a script `make_barcode_scanner.sh` which builds the
`BarcodeScannerView` library and its dependencies, `zxing-cpp` and
`CameraView` from source. Builds `zxing-cpp` architecture dependent
reducing the final apk size.
2025-06-30 17:20:01 +02:00
ghost43
5cb844fc7c Merge pull request #9945 from f321x/osx_sign_self_signed_cert
build-osx: add docs for testing with self-signed certificate
2025-06-30 14:08:05 +00:00
SomberNight
60bb425ed6 follow-up prev: add explanation 2025-06-30 14:05:21 +00:00
ghost43
1c014a7c85 Merge pull request #9967 from nabijaczleweli/hors-d'oeuvres
Populate tx_status_cache before it's used, not after. Only compute short_id when requested
2025-06-30 13:55:41 +00:00
ghost43
96a636d578 Merge pull request #9998 from f321x/hold_invoice_cli_hash
cli: use payment hash for hold invoice creation
2025-06-30 13:42:15 +00:00
Sander van Grieken
39c0523773 qml: only save invoice if canSave 2025-06-30 12:56:22 +02:00
f321x
389a0a6e91 cli: use payment hash for add_hold_invoice
Allowing to create hold invoices just by providing a payment hash
instead of the preimage right from the beginning allows for additional
use cases where the recipient doesn't have access to the preimage when
creating the invoice.
2025-06-30 09:34:05 +02:00
SomberNight
10e3bad884 qml: qeinvoice: don't use wallet.get_balance() for NotEnoughFunds checks
related https://github.com/spesmilo/electrum/issues/8835
2025-06-29 22:59:30 +00:00
SomberNight
ba670cc9dc wallet: add struct PiechartBalance 2025-06-29 22:25:56 +00:00
ghost43
405197b9ae Merge pull request #9995 from cloudclaim/master
chore: fix some minor issues in the comments
2025-06-29 14:06:26 +00:00
cloudclaim
06d1b730b7 chore: fix some minor issues in the comments
Signed-off-by: cloudclaim <824973921@qq.com>
2025-06-29 10:07:38 +08:00
SomberNight
0e4b3a3d58 commands: add comment about "timeout" args
really is black magic
2025-06-28 10:02:40 +00:00
SomberNight
50d48aee2d fee_policy: move regtest fallback even deeper 2025-06-28 04:29:50 +00:00
SomberNight
848e605a80 fee_policy: instead of checking has_data, handle "eta_to_fee() is None" 2025-06-28 04:10:38 +00:00
SomberNight
92bdf70c73 fee_policy: separate fallback static fee vs regtest hardcoded fee 2025-06-28 04:10:35 +00:00
SomberNight
ae70d204b0 daemon: should only log "Ignoring -w" for "daemon" command, not for gui 2025-06-28 03:17:27 +00:00
SomberNight
588363749c commands: fix convert_currency cmd 2025-06-27 15:15:12 +00:00
ghost43
ce64dea0a1 Merge pull request #9990 from f321x/payment_sent_colon
qt: remove colon in "Payment received:" notification
2025-06-27 11:15:14 +00:00
ghost43
bde2e23ca3 Merge pull request #9989 from f321x/swap_dialog_followup
qt: SwapDialog: update on changes, don't translate f-str
2025-06-27 11:13:43 +00:00
f321x
a50c088c4b qt: remove colon in "Payment received" notification
if there is no amount in the payment request the notification would look
weird as it would just show `Payment received:` indicating something
might be missing. Now it just says `Payment received` instead.
2025-06-27 12:49:12 +02:00
f321x
73249404d4 qt: SwapDialog: update on changes, don't translate fstr
and differenciate between a single 'provider' and multiple or 0
'providers'. Also update SwapDialog and SwapServerDialog
when new offers are incoming. Stops translating f-string.
2025-06-27 11:18:38 +02:00
ghost43
3f755e19a4 Merge pull request #9988 from SomberNight/202506_txbatcher_cleanup
txbatcher: add type-hints
2025-06-26 14:31:17 +00:00
SomberNight
2b92e8a97a txbatcher: add type-hints 2025-06-26 14:10:18 +00:00
ghost43
c2b99f08be Merge pull request #9977 from SomberNight/202506_qt_qrtextedit_rm_dupe
qt: qrtextedit: rm some duplication
2025-06-26 13:56:14 +00:00
ThomasV
56684c049a follow-up 2119bf2b23 2025-06-26 14:46:08 +02:00
ThomasV
2119bf2b23 Qt swaps_dialog: update send/recv amounts after changing provider.
Also, show current provider color icon in button
2025-06-26 14:20:12 +02:00
SomberNight
84cdbc930b commands: list_channels: include "closing_txid"
want to use this in regtests
2025-06-25 17:15:55 +00:00
SomberNight
b590c864ee config: fix setting CLI_TIMEOUT configvar, and add "convert_setter"s
"type_=float" behaves a bit weirdly. Was kinda broken before, still not fully "fixed" here.
With this commit, if used together with convert_setter, it at least behaves in a sane way.

```
$ ./run_electrum -o setconfig timeout 10
  1.16 | E | __main__ | error running command (without daemon)
Traceback (most recent call last):
  File "/home/user/wspace/electrum/./run_electrum", line 593, in handle_cmd
    result = fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/user/wspace/electrum/./run_electrum", line 268, in run_offline_command
    result = await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/commands.py", line 194, in func_wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/commands.py", line 408, in setconfig
    self._setconfig(key, value)
  File "/home/user/wspace/electrum/electrum/commands.py", line 398, in _setconfig
    cv.set(value)
  File "/home/user/wspace/electrum/electrum/simple_config.py", line 126, in set
    self._config_var._set_config_value(self._config, value, save=save)
  File "/home/user/wspace/electrum/electrum/simple_config.py", line 89, in _set_config_value
    raise ValueError(
ValueError: ConfigVar.set type-check failed. key='timeout'. type=<class 'float'>. value=10
```
2025-06-25 17:15:52 +00:00
SomberNight
fa0921e33b tests: regtest: add comments to swapserver tests 2025-06-25 17:15:47 +00:00
SomberNight
aeba531aa8 logging: keep more log files by default
To reduce chance an important log file gets lost due to the user restarting the app a couple times.
Perhaps we should make this smarter and cap based on bytes size of folder, instead of number of files.
2025-06-25 16:46:16 +00:00