1
0
Commit Graph

15812 Commits

Author SHA1 Message Date
ThomasV
2bf2d815d2 Qt: add tx and address counters 2023-03-13 12:25:55 +01:00
Sander van Grieken
0ebec200e2 qml: render fee histogram as a HSV gradient over next 25 blocks 2023-03-13 12:17:36 +01:00
ThomasV
cbab50e4ce channels_list: move swap and rebalance buttons into toolbar 2023-03-13 12:11:50 +01:00
ThomasV
303ad02d17 privacy analysis: add warning about tx downstream of address reuse 2023-03-13 11:41:36 +01:00
ThomasV
439f1e6331 settings_dialog: add confirmation dialog before disabling trampoline 2023-03-13 11:08:04 +01:00
ThomasV
e150a9ccad restructure settings_dialog, create 'Units' tab 2023-03-13 10:02:47 +01:00
ThomasV
519926ade3 move 'allow_instant_swaps' option from preferences dialog to swap_dialog toolbar 2023-03-13 09:53:08 +01:00
ThomasV
4909cebdae move recoverable channel option from preferences to new_channel_dialog toolbar 2023-03-13 09:36:02 +01:00
ThomasV
b15387c89b Qt send tab: move payto_edit input buttons to toolbar 2023-03-13 08:55:45 +01:00
ThomasV
eef1f0b2fd transaction_dialog: move tx_dialog_fetch_txin_data checkbox into toolbar 2023-03-13 08:16:44 +01:00
ThomasV
503776c0de move fiat columns show/hide settings from settings_dialog to tab toolbars 2023-03-12 13:30:11 +01:00
ThomasV
98f0526996 swap_dialog: minor fix 2023-03-12 11:54:44 +01:00
ThomasV
37a0e125c6 move config settings that are related to invoice creation to receive tab. 2023-03-12 10:42:26 +01:00
ThomasV
473c86c395 toolbar: use custom MyMenu class with addToggle 2023-03-12 10:11:08 +01:00
ThomasV
f87cac0498 Merge pull request #8241 from SomberNight/202303_wallet_split_add_input_info
split out network reqs from `wallet.add_input_info`, and add "Download input data" cb in qt tx dlg
2023-03-12 09:01:44 +01:00
SomberNight
d83863cc52 qt tx dialog: add checkbox "Download input data"
If checked, we download prev (parent) txs from the network, asynchronously.
This allows calculating the fee and showing "input addresses".

We could also SPV-verify the tx, to fill in missing tx_mined_status
(block height, blockhash, timestamp, short ids), but this is not done currently.
Note that there is no clean way to do this with electrum protocol 1.4:
`blockchain.transaction.get_merkle(tx_hash, height)` requires knowledge of the block height.

Loosely based on 6112fe0e51
2023-03-12 00:24:31 +00:00
Calin Culianu
c79074c4d8 qt: port "rate_limiter" function decorator utility from Electron-Cash
ported from e8bbf8280c/electroncash_gui/qt/util.py
(originally added in 8b8d8a5690 )

Co-authored-by: Calin Culianu <calin.culianu@gmail.com>
Co-authored-by: SomberNight <somber.night@protonmail.com>
2023-03-12 00:22:01 +00:00
SomberNight
81772faf6c wallet: add_input_info to no longer do network requests
- wallet.add_input_info() previously had a fallback to download parent
  prev txs from the network (after a lookup in wallet.db failed).
  wallet.add_input_info() is not async, so the network request cannot
  be done cleanly there and was really just a hack.
- tx.add_info_from_wallet() calls wallet.add_input_info() on each txin,
  in which case these network requests were done sequentially, not concurrently
- the network part of wallet.add_input_info() is now split out into new method:
  txin.add_info_from_network()
- in addition to tx.add_info_from_wallet(), there is now also tx.add_info_from_network()
  - callers of old tx.add_info_from_wallet() should now called either
    - tx.add_info_from_wallet(), then tx.add_info_from_network(), preferably in that order
    - tx.add_info_from_wallet() alone is sufficient if the tx is complete,
      or typically when not in a signing context
- callers of wallet.bump_fee and wallet.dscancel are now expected to have already
  called tx.add_info_from_network(), as it cannot be done in a non-async context
  (but for the common case of all-inputs-are-ismine, bump_fee/dscancel should work regardless)
- PartialTxInput.utxo was moved to the baseclass, TxInput.utxo
2023-03-12 00:21:57 +00:00
SomberNight
9439261e42 network: fix bug in best_effort_reliable
self.interface might get set to None after decorator checks it but before func gets scheduled:

125.04 | E | asyncio | Task exception was never retrieved
future: <Task finished name='Task-408' coro=<Transaction.add_info_from_network.<locals>.add_info_to_txin() done, defined at ...\electrum\electrum\transaction.py:976> exception=AttributeError("'NoneType' object has no attribute 'get_transaction'")>
Traceback (most recent call last):
  File "...\electrum\electrum\transaction.py", line 980, in add_info_to_txin
    await txin.add_info_from_network(network=network, ignore_network_issues=ignore_network_issues)
  File "...\electrum\electrum\transaction.py", line 375, in add_info_from_network
    self.utxo = await fetch_from_network(txid=self.prevout.txid.hex())
  File "...\electrum\electrum\transaction.py", line 362, in fetch_from_network
    raw_tx = await network.get_transaction(txid, timeout=10)
  File "...\electrum\electrum\network.py", line 866, 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 1410, in join
    self.completed.result()
  File "...\electrum\electrum\network.py", line 889, in wrapper
    return await func(self, *args, **kwargs)
  File "...\electrum\electrum\network.py", line 1114, in get_transaction
    return await self.interface.get_transaction(tx_hash=tx_hash, timeout=timeout)
AttributeError: 'NoneType' object has no attribute 'get_transaction'
2023-03-12 00:20:52 +00:00
SomberNight
6a049a335a transaction: run validate_data before setting .utxo, not after
Feels safer.
2023-03-11 22:57:45 +00:00
ThomasV
5ad4023e7d restore invoices_label and requests_label. move paytomany and toggle_qr_window from main menu to toolbar 2023-03-11 18:08:00 +01:00
ThomasV
d6a65a06a7 Qt: move remaining menu items that are tab specific to tab toolbars: history, addresses, contacts 2023-03-11 17:47:01 +01:00
ThomasV
c595df3972 Qt: call create_toolbar in create_list_tab 2023-03-11 15:41:13 +01:00
ThomasV
1a0a52f9b6 invoices and requests lists: move import/export menus into local toolbars 2023-03-11 15:15:16 +01:00
ThomasV
f89a466d61 minor fix 2023-03-10 18:02:47 +01:00
Sander van Grieken
7e5ebf0484 swap: wrap coros in tasks (req since python3.11) 2023-03-10 15:28:59 +01:00
Sander van Grieken
a595102d5f qml: auto sign and broadcast for cancel txs too 2023-03-10 15:28:59 +01:00
SomberNight
7746cc8e60 bip32: (trivial) rename method strpath_to_intpath, for symmetry
Required a much higher mental load to parse the name "convert_bip32_path_to_list_of_uint32"
than to parse "convert_bip32_strpath_to_intpath".
And we already have the ~inverse: "convert_bip32_intpath_to_strpath".
2023-03-10 14:23:17 +00:00
SomberNight
f2dc651c9b Qt history list: Ctrl+F filter to work for "Short ID" (scid) 2023-03-10 14:03:57 +00:00
Sander van Grieken
15a3c2d344 qml: auto sign & broadcast fee bump transactions if wallet can sign without cosigners.
Show a dialog otherwise
2023-03-10 13:31:41 +01:00
Sander van Grieken
cb5a9e499f qml: SwapDialog ok button 2023-03-10 12:52:04 +01:00
ThomasV
d0b2c66550 confirm_tx_dialog: simplify messages and warnings. reduce the use of side effects 2023-03-10 11:46:36 +01:00
ThomasV
df94bc0d60 TxInOutWidget: reduce size of displayed addresses 2023-03-10 10:52:32 +01:00
Sander van Grieken
ffb899871f qml: don't explicitly add new channel to listmodel. It is updated automatically (and the
model refreshed) through the channels_updated callback
2023-03-10 10:25:14 +01:00
Sander van Grieken
016eea2c04 qml: more robust keystore properties builder, support imported type 2023-03-09 21:49:42 +01:00
Sander van Grieken
aaca7c58ad qml: BalanceSummary now flipflops between fiat view and btc view 2023-03-09 17:16:22 +01:00
Sander van Grieken
c0e7fc6dec qml: don't show placeholder in History when empty history list and synchronizing 2023-03-09 16:19:10 +01:00
SomberNight
62ab6d9702 (trivial) reduce log spam during ln-channel-open 2023-03-09 15:18:09 +00:00
Sander van Grieken
1210ef5f81 qml: various styling 2023-03-09 16:13:46 +01:00
SomberNight
7584ba00ce wallet: kill negative conf numbers for TxMinedInfo
fixes https://github.com/spesmilo/electrum/issues/8240

#8240 was triggering an AssertionError in wallet.get_invoice_status,
as code there was assuming conf >= 0. To trigger, force-close
a LN channel, and while the sweep is waiting on the CSV, try to
make a payment in the Send tab to the ismine change address used
for the sweep in the future_tx. (order of events can also be reversed)
2023-03-09 14:59:08 +00:00
Sander van Grieken
d717471389 qml: move PIN one section up in Preferences 2023-03-09 15:38:29 +01:00
Sander van Grieken
b5e7887fa4 qml: move channel backups to WalletDetails 2023-03-09 15:37:51 +01:00
Sander van Grieken
c6be2521ef qml: relabel Export tx to Share 2023-03-09 15:19:33 +01:00
Sander van Grieken
0423970ae0 qml: add word picker to SeedTextArea 2023-03-09 15:09:16 +01:00
ThomasV
d9f1a21219 reverse_swap: return as soon as we detect the funding transaction 2023-03-09 14:57:43 +01:00
ThomasV
b960433c60 confirm_tx_dialog: Use future tense in warnings + minor fix 2023-03-09 14:40:08 +01:00
ThomasV
c449c8eda8 set NoWrap for tx input/outputs. Use QTextBrowserWithDefaultSize in utxo dialog. 2023-03-09 11:26:40 +01:00
Sander van Grieken
f7a300b89b qml: successful PIN entry stays valid for 5 mins 2023-03-09 10:19:17 +01:00
Sander van Grieken
db467ff1f7 qml: remove not implemented new version check option in Preferences 2023-03-09 10:01:06 +01:00
ThomasV
37b29b1f37 confirm_tx_dialog: fix toggle_output_rounding 2023-03-08 18:44:29 +01:00