Commit graph

70 commits

Author SHA1 Message Date
SomberNight
d5f368c584
LN invoices: support msat precision
fixes #6250
2020-06-22 22:48:13 +02:00
ThomasV
6058829870 Use attr.s classes for invoices and requests:
- storage upgrade
 - fixes #6192
 - add can_pay_invoice, can_receive_invoice to lnworker
2020-06-01 21:02:45 +02:00
SomberNight
93c90a30f0
qt MyTreeView: impl custom sort order framework, and use for invoices
sort invoices and payreqs (for Date column) based on timestamps
(timestamps have second resolution while the displayed date has minute resolution)
2020-05-15 15:32:18 +02:00
SomberNight
2a4b516f16
qt receive tab: fix refresh bug on macOS
related: #4777
2020-05-14 20:24:21 +02:00
ThomasV
f67011d477 Qt: do not filter out paid invoices/requests. let user delete multiple items 2020-03-03 12:56:44 +01:00
ThomasV
94443ebe5e Qt: list requests and invoices in descending order 2020-03-03 11:25:54 +01:00
ThomasV
abb0760616 Simplify receive tab:
- display receiving address in receiving tabs
 - display lightning invoice as 'address'
 - save last active tab in preferences
2020-03-03 11:10:48 +01:00
SomberNight
84797f90d0
qt request_list: clear receive addr/req when hiding list 2020-02-23 21:23:56 +01:00
SomberNight
4c2e1970f2
qt receive tab: better "Clear" behaviour
Previously, the selection would not get cleared, and if the user clicked
again on the already selected item, the click would get ignored
(request would not get populated).
2020-02-23 21:18:46 +01:00
SomberNight
5fd790dec9
follow-up prev
These lists are only visible when non-empty. This interacts badly with
the internals of maybe_defer_update().
2020-01-21 11:51:02 +01:00
SomberNight
1d0fc6665b
qt: defer refreshing tabs until they are visible
very loosely based on Electron-Cash/Electron-Cash@522e7ca59e
2020-01-19 07:31:50 +01:00
SomberNight
356a0a2865
qt: clean-up in some MyTreeView children (mv code from update to init) 2020-01-19 07:02:48 +01:00
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
f08796fe68 Allow requests that never expire 2019-12-10 14:45:29 +01:00
SomberNight
d2a8028cde
qt receive tab: show plain bitcoin address 2019-12-07 06:06:36 +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
1526bc9ccf
qt: consistently show tooltip when copying to clipboard 2019-11-21 03:01:55 +01:00
SomberNight
aa3d817ef2
qt: clean-up imports 2019-11-18 20:56:49 +01:00
ThomasV
a0ec2690cf Call wallet.set_paid after onchain broadcast. Check if invoices are expired in util.get_request_status 2019-10-23 17:33:46 +02:00
ThomasV
c721e880d0 Qt: generic add_copy_menu method for MyTreeView lists 2019-10-16 15:50:18 +02:00
ThomasV
d1f4804962 misc Qt fixes
- improve layout of send tab
 - use tabs to show receive widgets
 - add menu item to copy address from request
 - show copied content in copy dialog
2019-10-16 11:46:23 +02:00
ThomasV
aaed594772 Simplify invoices and requests.
- We need only two types: PR_TYPE_ONCHAIN and PR_TYPE_LN
 - BIP70 is no longer a type, but an optional field in the dict
 - Invoices in the wallet are indexed by a hash of their serialized list of outputs.
 - Requests are still indexed by address, because we never generate Paytomany requests.
 - Add 'clear_invoices' command to CLI
 - Add 'save invoice' button to Qt
2019-09-12 20:11:20 +02:00
ThomasV
cefa4762ba do not create multiple instances of SimpleConfig (fix #5629). Add config field to wallet 2019-09-10 08:57:40 +02:00
ThomasV
128285a050 http server: add ssl and bip70 signed requests 2019-09-05 10:57:50 +02:00
ThomasV
deb97567fb Qt: fix request menu 2019-09-04 12:52:32 +02:00
ThomasV
747ab7a0a2 Integrate http_server (previously in electrum-merchant)
Use submodule to fetch HTML and CSS files
2019-09-04 12:20:05 +02:00
ThomasV
a50f935aec Restructure invoices and requests (WIP)
- Terminology: use 'invoices' for outgoing payments, 'requests' for incoming payments
 - At the GUI level, try to handle invoices in a generic way.
 - Display ongoing payments in send tab.
2019-09-02 15:35:44 +02:00
ThomasV
8010123c08 Display and refresh the status of incoming payment requests:
- All requests have an expiration date
 - Paid requests are automatically removed from the list
 - Unpaid, unconfirmed and expired requests are displayed
 - Fix a bug in get_payment_status, conf was off by one
2019-08-22 06:00:45 +02:00
ThomasV
98a1c9268a qt: do not show paid requests 2019-08-20 09:03:12 +02:00
ThomasV
70cd29f9e1 GUI refactoring for Kivy and lightning.
This also touches Qt and wallet code.
2019-08-20 09:03:12 +02:00
ThomasV
234591624e request_lists: remove non-sense 2019-08-20 09:03:11 +02:00
ThomasV
e53ecb9b77 add labels to lightning history 2019-08-20 09:03:11 +02:00
ThomasV
842fff832f enable lightning through command line option 2019-08-20 09:03:11 +02:00
ThomasV
8d77a7ecd8 save timestamps in htlc log 2019-08-20 09:03:11 +02:00
SomberNight
962628ac3d lnworker: minor clean-up re payment_completed 2019-08-20 09:03:11 +02:00
SomberNight
828f07a1ff qt request_list: disable editing existing items 2019-08-20 09:03:11 +02:00
SomberNight
f0b4d1ecce qt request_list: minor fix for context menu 2019-08-20 09:03:11 +02:00
SomberNight
64b2844e81 qt request_list: fix changing between items 2019-08-20 09:03:11 +02:00
ThomasV
62be0c481c lightning: Save invoices and preimages separately. Save preimages when forwarding 2019-08-20 09:03:11 +02:00
SomberNight
2976f50b8c lightning post-rebase fixups 2019-08-20 09:03:11 +02:00
Janus
f5cee9ecf6 lightning: post-rebase fixes, read_QIcon and invalid import 2019-08-20 09:03:11 +02:00
ThomasV
7bb4ea150f gui: show incoming lightning requests, add on-chain icon 2019-08-20 09:03:11 +02:00
ThomasV
2af178a586 Store boolean is_received in lightning invoices. Sort lightning history with timestamp. Minor fixes 2019-08-20 09:03:11 +02:00
ThomasV
0e8dba897e lightning:
* store invoices for both directions
* do not store lightning_payments_inflight, lightning_payments_completed in lnworker
* payment history is returned by get_payments method of LNChannel
* command line: lightning history, lightning_invoices
* re-enable push_msat
2019-08-20 09:03:11 +02:00
ThomasV
b0d6000771 turn lightning_payments_completed into dict. Show status of lightning payments in GUI. Make 'listchannels' available offline 2019-08-20 09:03:11 +02:00
Janus
1f1207ecbe ln: request_list: post rebase fixup (remove new_request_button deactivation) 2019-08-20 09:03:11 +02:00
ThomasV
02798aeb39 sort requests by date 2019-08-20 09:03:11 +02:00
ThomasV
3ce0f7f0cd simplify requests list 2019-08-20 09:03:11 +02:00
Janus
ef88bb1c28 request_list: select new items 2019-08-20 09:03:11 +02:00
Janus
9cbf55f977 request_list: do not mention that ln invoice is bolt-11 2019-08-20 09:03:11 +02:00