Commit graph

907 commits

Author SHA1 Message Date
SomberNight
7b49832a3f
payment requests: fix explicit "None" expiration
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 994, in <lambda>
    self.create_invoice_button.clicked.connect(lambda: self.create_invoice(False))
  File "...\electrum\electrum\gui\qt\main_window.py", line 1123, in create_invoice
    key = self.create_bitcoin_request(amount, message, expiry)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1132, in create_bitcoin_request
    addr = self.wallet.get_unused_address()
  File "...\electrum\electrum\wallet.py", line 1452, in wrapper
    addr = func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet.py", line 1465, in get_unused_address
    addrs = self.get_unused_addresses()
  File "...\electrum\electrum\wallet.py", line 1459, in get_unused_addresses
    in_use_by_request = [k for k in self.receive_requests.keys() if self.get_request_status(k)[0] != PR_EXPIRED]
  File "...\electrum\electrum\wallet.py", line 1459, in <listcomp>
    in_use_by_request = [k for k in self.receive_requests.keys() if self.get_request_status(k)[0] != PR_EXPIRED]
  File "...\electrum\electrum\wallet.py", line 1535, in get_request_status
    if exp > 0 and time.time() > timestamp + exp:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2019-12-16 21:03:34 +01:00
ThomasV
2c6a1f55fb
Merge pull request #5825 from SomberNight/201912_local_tx_can_be_partial
wallet: allow saving partial tx as local (if it has a txid)
2019-12-15 16:40:46 +01:00
SomberNight
3a2fe80675
qt: also use BlockWaitingDialog in PreviewTxDialog
as when 'advanced_preview' is set, ConfirmTxDialog is skipped

follow-up 1088cf4444
2019-12-12 21:39:46 +01:00
SomberNight
dbd1c8cf71
qt TxDialog: visibility of widgets should be set after parenting
widget.show() and widget.setVisible(True) results in a blink of an ephemeral window containing the widget;
that is, unless the widget has a parent explicitly set or it can be determined via which layout the widget is placed in.
2019-12-12 21:31:30 +01:00
SomberNight
c9ede07462 wizard: (qt) add dedicated button to create new wallet 2019-12-12 17:54:46 +01:00
ThomasV
7324817ff3
Merge pull request #5833 from SomberNight/201912_qt_blocking_waiting_dialog
Qt: introduce BlockingWaitingDialog
2019-12-12 17:53:03 +01:00
SomberNight
d08ed6410a
python3.8: fix DeprecationWarning in qt/paytoedit
.../electrum/electrum/gui/qt/paytoedit.py:221: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  self.setMinimumHeight(h)
2019-12-10 23:01:01 +01:00
ThomasV
f08796fe68 Allow requests that never expire 2019-12-10 14:45:29 +01:00
SomberNight
1088cf4444
qt: introduce BlockingWaitingDialog
A variant of WaitingDialog that runs the task in the GUI thread,
blocking the GUI. It is probably a code smell to actually use this,
as operations should not block the GUI... still it provides a middle-ground
between blocking the GUI without giving user-feedback and having to refactor
existing code (to avoid blocking).
2019-12-10 03:34:41 +01:00
SomberNight
b99add59c3
lnworker: introduce PaymentAttemptLog NamedTuple 2019-12-10 03:17:57 +01:00
SomberNight
f2d42d79ba
qt: rm redundant line: ConfirmTxDialog.update_tx()
already called in ConfirmTxDialog.__init__
2019-12-09 19:14:15 +01:00
ThomasV
9d83dea0dc
Merge pull request #5822 from SomberNight/201912_qt_receive_tab_address
qt receive tab: show plain bitcoin address
2019-12-09 10:57:14 +01:00
SomberNight
30dcab0877
wallet: allow saving partial txns as local (but require txid) 2019-12-08 04:32:44 +01:00
SomberNight
369d972aed
qt: handle exceptions when pressing "Max" button
fixes #5783
2019-12-08 03:21:02 +01:00
SomberNight
d2a8028cde
qt receive tab: show plain bitcoin address 2019-12-07 06:06:36 +01:00
SomberNight
20bbe85bce
receive requests: encode lightning invoices as uppercase -> smaller QRs
By encoding bolt11 invoices as uppercase text in QR codes,
we can use the alphanumeric mode, which results in non-negligibly smaller QR codes.
2019-12-07 05:58:58 +01:00
SomberNight
d81110014e
qt requests/invoices: use TreeView.sortByColumn instead of model.sort
sort the view, not the model
This way, qt will display the icon indicating the sort order on the relevant column header.
2019-12-07 04:28:08 +01:00
SomberNight
e0eb3c18eb
qt ConfirmTxDialog: don't catch BaseException for make_tx
not sure what it is supposed to catch...
The examples I could come up with would all be actual bugs;
in which case we should let the exception propagate out to the crash reporter.
2019-12-06 20:41:51 +01:00
SomberNight
61aebd0f2d
(fix) qt coin selection: signatures for coins would persist in memory
Scenario: select some UTXOs in the 'Coins' tab. Create a tx and sign it.
Close the tx dialog without broadcasting/etc (cancel tx).
Signatures would remain for selected UTXOs.
Create new tx -> invalid sigs.
2019-12-06 19:45:55 +01:00
ThomasV
7a080352f8
Merge pull request #5809 from SomberNight/201911_invoice_paid_detection
wallet: better (outgoing) invoice "paid" detection
2019-11-29 18:24:08 +01:00
SomberNight
8dbbc21aff
wallet: better (outgoing) invoice "paid" detection
- no more passing around "invoice" in GUIs, invoice "paid" detection is now handled by wallet logic
- a tx can now pay for multiple invoices
- an invoice can now be paid by multiple txs (through partial payments)
- new data structure in storage: prevouts_by_scripthash
  - type: scripthash -> set of (outpoint, value)
  - also, storage upgrade to build this for existing wallets
2019-11-29 15:06:16 +01:00
roth
2ce8dd460b Color-Code Addresses in Kivy UI (#5774)
* Added static coloring of the TX output dialog.

Coloring was suggested in #5750
2019-11-28 20:40:28 +00:00
SomberNight
4007720b34
qt history list: rm and fix magic number 2019-11-27 20:29:49 +01:00
SomberNight
cee2083134
qt history list: fix UnboundLocalError when searching
closes #5801
2019-11-27 04:30:38 +01:00
SomberNight
ddeb176b3d
kivy: fix open_channel (API was changed) 2019-11-23 20:50:30 +01:00
SomberNight
557987d4eb
add/fix some open_channel related type hints 2019-11-23 20:28:46 +01:00
ThomasV
fd8236538a Open lightning channels with partially signed tx.
Fixes #5379.
2019-11-23 19:49:12 +01:00
ThomasV
9c9ceb702a fix #5729 2019-11-23 15:12:16 +01:00
ThomasV
b9e5edd704 fix #5728 2019-11-23 14:51:39 +01:00
ThomasV
06589df812 simplify add_transaction 2019-11-23 12:46:43 +01:00
ThomasV
fc85dcead6 follow-up previous commit 2019-11-23 11:37:01 +01:00
ThomasV
6c62fb03ac fix #5733 2019-11-23 11:02:31 +01:00
ThomasV
61dfcba092 Refactor channel states:
- persisted states are saved
 - state transitions are checked
 - transient states are stored in channel.peer_state
 - new channel states: 'PREOPENING', 'FUNDED' and 'REDEEMED'
 - upgrade storage to version 21
2019-11-22 20:14:54 +01:00
SomberNight
03cc63205f
trivial: use logger.exception instead of traceback.print_exc 2019-11-21 17:55:00 +01:00
SomberNight
6f246a83b3
qt coin selection: allow selecting an empty set
Using this, the user can force "bump fee" not to add new inputs.

closes #5719
2019-11-21 17:46:00 +01:00
SomberNight
11f54aee60
qt utxo list: spend_list is now a set (and renamed)
this is a small performance improvement ("if x in spend_list" was linear)
and the "order" of selected coins does not matter anyway
2019-11-21 17:21:54 +01:00
SomberNight
1526bc9ccf
qt: consistently show tooltip when copying to clipboard 2019-11-21 03:01:55 +01:00
Johann Bauer
9fe7917118
Qt: Remove unused color from color scheme 2019-11-20 21:11:41 +01:00
SomberNight
49284f716b
wallet: bump fee now supports coin selection
related: #5719
2019-11-20 18:43:05 +01:00
SomberNight
fec9677508
qt open channel: minor dialog fixes 2019-11-20 18:00:45 +01:00
SomberNight
cd9477c0da
ln: qt channel open: fix max channel size 2019-11-20 17:45:28 +01:00
SomberNight
4057140e6a
lightning qr codes: more robust parsing
kivy qr code handling did not accept "lightning:" prefix or uppercase
2019-11-20 03:21:59 +01:00
SomberNight
d1c262def0
qt tx dialog: small clean-up in constructors 2019-11-19 22:17:52 +01:00
SomberNight
97056ae44d
qt send tab: subtract 2fa fee when clicking "spend max" 2019-11-19 21:22:49 +01:00
SomberNight
ca6654c102
qt send tab: don't allow paying multiple invoices that spend max '!' 2019-11-19 20:26:50 +01:00
SomberNight
710e9621b5
qt tx dialog: allow blanking feerate
Previously it was impossible to rm the last character in feerate_edit.
e.g. if you held down "backspace", we would keep refilling the field as soon
as it became empty.
2019-11-19 20:13:16 +01:00
SomberNight
13b858ab26
qt tx dialog: disable "Finalize" btn if tx is None
e.g. NotEnoughFunds due to too high fee
2019-11-19 19:35:57 +01:00
SomberNight
66ddedb97e
qt tx dialog: small fee edit fix
scenario: enter extremely high feerate (which we cannot satisfy) then click into fee_edit.
At that moment, fee_edit is empty and both feerate_edit and fee_edit are considered frozen.
As fee_edit has priority, we would construct a tx with default fee.
Now, instead, we won't construct this default fee tx ~as if the click to fee_edit did not happen.
2019-11-19 19:29:10 +01:00
SomberNight
8bd27851a4
qt tx dialog: only allow "save as local" for complete txns 2019-11-19 18:41:44 +01:00
SomberNight
aa3d817ef2
qt: clean-up imports 2019-11-18 20:56:49 +01:00