1
0
Commit Graph

5268 Commits

Author SHA1 Message Date
ThomasV
36a6fd6311 request_force_close_from_backup:
- for an onchain backups, if the channel is with a
   hardcoded trampoline, try first without gossip DB.
 - for imported backups, fallback to gossip DB if we
   fail to connect with the provided network address.
2022-07-11 11:16:43 +02:00
SomberNight
9b8750b9cc wallet.export_invoice: should support onchain invoice with "!" (max) amount
As the GUI allows saving such invoices, CLI should not break for these wallets.
Also note the pre-existing assert on the next line.

follow-up bf4455ef30

```
>>> list_invoices()
Traceback (most recent call last):
  File "...\electrum\gui\qt\main_window.py", line 1506, in <lambda>
    return lambda *args, **kwargs: f(method,
  File "...\electrum\commands.py", line 191, in _run
    result = fut.result()
  File "...\Python310\lib\concurrent\futures\_base.py", line 446, in result
    return self.__get_result()
  File "...\Python310\lib\concurrent\futures\_base.py", line 391, in __get_result
    raise self._exception
  File "...\electrum\commands.py", line 154, in func_wrapper
    return await func(*args, **kwargs)
  File "...\electrum\commands.py", line 1188, in list_invoices
    return [wallet.export_invoice(x) for x in l]
  File "...\electrum\commands.py", line 1188, in <listcomp>
    return [wallet.export_invoice(x) for x in l]
  File "...\electrum\wallet.py", line 2405, in export_invoice
    amount_sat = int(x.get_amount_sat())
ValueError: invalid literal for int() with base 10: '!'
```
2022-07-10 16:26:20 +02:00
SomberNight
68581ce80a invoices: fix type hint for get_address() 2022-07-10 16:08:02 +02:00
ThomasV
fbd7d504a8 Merge pull request #7884 from SomberNight/202207_wallet_rm_get_onchain_request_status
wallet: rm get_onchain_request_status; just use is_onchain_invoice_paid
2022-07-09 10:42:12 +02:00
SomberNight
e72f575eea android build: factor out package name ("org.electrum.electrum")
to make it easier to change, to make it easy to have a co-existing mainnet and testnet install
(or two mainnet installs, etc)
2022-07-09 04:47:32 +02:00
SomberNight
bcbe69672e qml gui: fix flake8 "F821 undefined name" errors 2022-07-09 03:49:45 +02:00
SomberNight
9c5277c9a1 wallet: rm get_onchain_request_status; just use is_onchain_invoice_paid
There is some duplication between `wallet.get_onchain_request_status` and `wallet.is_onchain_invoice_paid`
(both in terms of code, and conceptually). `get_onchain_request_status` is used for incoming invoices (receive requests),
and `is_onchain_invoice_paid` is used for outgoing invoices. I think `get_onchain_request_status` existed first,
but as it uses txi/txo, it only works for ismine addresses, so `is_onchain_invoice_paid` was added later
(along with a `get_prevouts_by_scripthash` and corresponding new persisted data structure) to handle the non-ismine
addresses corresponding to outgoing invoices.

I think we could just merge the two functions together... (?)
and this PR does that.
2022-07-09 03:32:33 +02:00
SomberNight
60a0fcb6e5 Merge branch 'android-qml' 2022-07-08 19:45:11 +02:00
Sander van Grieken
2c92174ee0 qewallet: fix useNotify signal emit 2022-07-08 16:27:18 +02:00
Sander van Grieken
2c656a0cf7 add excepthooks, hoping to force a backtrace log when qt5 SIGABRTs 2022-07-08 16:25:44 +02:00
Sander van Grieken
a5fc067481 take out routing hints retrieval for display for now. 2022-07-08 12:32:27 +02:00
ThomasV
dce39b38ce lnchannel: do not expose COOP_CLOSE in the GUI if there are unsettled HTLCs 2022-07-08 12:27:04 +02:00
Sander van Grieken
f5933da348 skip wallet files with leading dot 2022-07-08 11:10:15 +02:00
Sander van Grieken
0228169852 refactor to new event listener framework 2022-07-08 11:09:08 +02:00
Sander van Grieken
1f827f71d2 add info text for all remaining invoice states 2022-07-07 18:30:20 +02:00
Sander van Grieken
537dbab522 fix canRbf value in Send.qml 2022-07-07 18:30:20 +02:00
Sander van Grieken
2a13212ded implement auth by PIN and allow auth override to wallet password
by passing method='wallet' to auth_protect
2022-07-07 18:30:20 +02:00
Sander van Grieken
cc778356eb allow paying when lightning invoice is in status FAILED 2022-07-07 18:30:20 +02:00
Sander van Grieken
cd6d5e577b add unified wallet password support 2022-07-07 18:30:20 +02:00
Sander van Grieken
0130e5aecf invert (in)validPassword property in QEWalletDB, add invalidPassword signal.
This is to better support state in OpenWallet page
2022-07-07 18:30:20 +02:00
Sander van Grieken
e289b8b46c move channels_updated event handling to ui thread, fix some debug statements 2022-07-07 18:30:20 +02:00
Sander van Grieken
dc50da6c62 channel freeze menu items only enabled when channel is open 2022-07-07 18:30:20 +02:00
Sander van Grieken
7298dd0ab7 clean up list of outputs in ConfirmTxDialog 2022-07-07 18:30:20 +02:00
Sander van Grieken
6fecf5b962 disable new_channel call for now as channel is otherwise added twice 2022-07-07 18:30:20 +02:00
Sander van Grieken
6a1c39728f add 'spend unconfirmed' config option 2022-07-07 18:30:20 +02:00
Sander van Grieken
f2857243cb show 'press again to quit' message when pressing back on last page in the stack 2022-07-07 18:30:20 +02:00
Sander van Grieken
cbd4d2a2ae make rbf selection allowed configurable 2022-07-07 18:30:20 +02:00
Sander van Grieken
982639919d make sure historymodel is initialized 2022-07-07 18:29:21 +02:00
Sander van Grieken
db9e2ab311 delete channel 2022-07-07 18:29:21 +02:00
Sander van Grieken
456b6048ea properly count open channels, add open channel to hamburger menu 2022-07-07 18:29:21 +02:00
Sander van Grieken
b2fafcb428 add initial submarine swap functionality 2022-07-07 18:29:02 +02:00
Sander van Grieken
a44f8d9b3b create new wallet name suggestion and pre-select and focus the textfield 2022-07-07 18:29:02 +02:00
Sander van Grieken
7a26ab259c update channel listmodel when channel opened 2022-07-07 18:29:02 +02:00
Sander van Grieken
2907698c17 support for MAX amounts 2022-07-07 18:29:02 +02:00
Sander van Grieken
e69fc739ca add initial channel close dialog 2022-07-07 18:29:02 +02:00
Sander van Grieken
71cd996379 InvoiceDialog: add balance & expired checks on invoices, add a few ln invoice fields to show 2022-07-07 18:29:02 +02:00
Sander van Grieken
c79651f981 also unregister callbacks from qewallet and qechannellistmodel on destroy 2022-07-07 18:29:02 +02:00
Sander van Grieken
f0d00dca37 unregister callback when object gets destroyed.
turns out we need to use a lambda to have the signal processed,
registering the member function somehow never triggers the
'destroyed' signal
2022-07-07 18:29:02 +02:00
Sander van Grieken
2c40a976b9 copy & share lightning requests 2022-07-07 18:29:02 +02:00
Sander van Grieken
4c9f713f9a further separate invoice objects 2022-07-07 18:29:02 +02:00
Sander van Grieken
12d726efc2 split user entered fields object from invoice uri parsing object 2022-07-07 18:29:01 +02:00
Sander van Grieken
04ce548e42 initial lightning channel details, action menu 2022-07-07 18:29:01 +02:00
Sander van Grieken
329bbaff3d tabbar minor 2022-07-07 18:29:01 +02:00
Sander van Grieken
9243f3b896 implement wallet password change.
implement wallet delete (though actual wallet file delete is left out still)
2022-07-07 18:29:01 +02:00
Sander van Grieken
e9a174711b UI on Wallets screen. Add active/not active/current indicator tags.
initial wallet delete/change password boilerplate
2022-07-07 18:29:01 +02:00
Sander van Grieken
0d0aed1aaa fixes after rebase a3faf85e3c 2022-07-07 18:29:01 +02:00
Sander van Grieken
c505de2fe0 fixes after rebase persist_lnwatcher 2022-07-07 18:29:01 +02:00
Sander van Grieken
7cb8c347b5 Add @auth_protect decorator.
This guards function calls by storing the function, args and kwargs into
an added attribute '__auth_fcall' on the object using the decorator,
then emits a signal that can be handled by the UI.

The UI can signal auth-success or auth-failure back to the object by
calling either the authProceed() slot or the authCancel slot.

The object utilizing this decorator MUST inherit/mixin the AuthMixin
class, which provides the above two slots, and handling of state.

The decorator also accepts a 'reject' parameter, containing the name of
a parameterless function on the object, which is called when
authentication has failed/is cancelled.
2022-07-07 18:29:01 +02:00
Sander van Grieken
0b8de89e66 add hamburger menu to Wallets page 2022-07-07 18:29:01 +02:00
Sander van Grieken
f8dd411148 styling 2022-07-07 18:29:01 +02:00