Commit graph

44 commits

Author SHA1 Message Date
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
SomberNight
03cc63205f
trivial: use logger.exception instead of traceback.print_exc 2019-11-21 17:55:00 +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
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
a20317fe2a
fix #5726 2019-10-28 21:17:20 +01:00
ThomasV
24221584e2 fix clear_requests button 2019-10-24 09:32:40 +02: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
aac0fe9ae6 kivy: show status with color. show inflight attempts. 2019-10-22 15:41:45 +02:00
ThomasV
576fbbd074 kivy: minor fixes 2019-10-22 11:59:16 +02:00
ThomasV
f08e5541ae Refactor invoices in lnworker.
- use InvoiceInfo (NamedTuple) for normal operations,
   because lndecode operations can be very slow.
 - all invoices/requests are stored in wallet
 - invoice expiration detection is performed in wallet
 - CLI commands: list_invoices, add_request, add_lightning_request
 - revert 0062c6d695 because it forbids self-payments
2019-09-22 16:06:53 +02:00
SomberNight
c7346c1eb8
kivy: fix paying onchain invoices
when pasting a new invoice and paying it
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
    tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
    if o.type == TYPE_ADDRESS:
AttributeError: 'tuple' object has no attribute 'type'

when loading back a saved invoice
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 358, in _do_send_onchain
    tx = self.app.wallet.make_unsigned_transaction(coins, outputs, None)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 849, in make_unsigned_transaction
    if o.type == TYPE_ADDRESS:
AttributeError: 'list' object has no attribute 'type'
2019-09-13 15:00:34 +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
79de0489e3 kivy: do not remove fee from tx value in history (minor) 2019-09-12 12:32:38 +02:00
ThomasV
65b88dca86 return fees in history, show them in kivy GUI 2019-09-11 17:49:40 +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
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
3076eb75ea make parsing lightning qr codes more robust 2019-08-27 17:12:43 +02:00
ThomasV
e9c32bad19 kivy: remove context menus, cleanup unused files 2019-08-23 12:15:42 +02:00
ThomasV
587f8aa487 Kivy GUI improvements:
- create unique instances of channels_dialog and addresses_dialog
 - display and refresh balances in channels_dialog
 - improve formatting of tx history
 - repurpose left button in receive_tab
2019-08-22 19:04:32 +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
336cf81a6d kivy: add expiration button to receive screen 2019-08-20 18:20:54 +02:00
ThomasV
27a9d02b8c kivy: update receive screen after adding request 2019-08-20 16:07:40 +02:00
ThomasV
46c2d7821f kivy: show pending requests in receive tab instead of dialog 2019-08-20 09:03:12 +02:00
ThomasV
f8038d024b kivy: lnpay_thread 2019-08-20 09:03:12 +02:00
ThomasV
af7d7e883c Rework wallet history methods:
- wallet.get_full_history returns onchain and lightning
 - capital gains are returned by get_detailed_history
 - display lightning history in kivy
 - command line: separate lightning and onchain history
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
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
e3409d32ef channel details with list of htlcs 2019-08-20 09:03:11 +02:00
Janus
9d32031ca2 Kivy: Lightning support in Receive tab 2019-08-20 09:03:11 +02:00
Janus
7db9a22d63 Kivy: open channel dialog 2019-08-20 09:03:11 +02:00
Janus
1352b0ce9f Kivy: Support Lightning in Send tab 2019-08-20 09:03:11 +02:00
SomberNight
f60f690ca9
change many str(e) to repr(e) as some exceptions were cryptic
it's often valuable to see the type of the exception
(especially as for some exceptions str(e) == '')
2019-07-17 20:12:52 +02:00
SomberNight
1ebfcc0f36
kivy: "paste" button now works for transactions 2019-05-26 02:46:25 +02:00
SomberNight
3b445d7248
fix #5376 2019-05-25 05:13:57 +02:00
SomberNight
158090bf8b
util.parse_URI: more granular exceptions
related: #5376

first report in #5376 was generated with these changes;
before, the exception was caught and a toast displayed "Not a Bitcoin URI"
2019-05-25 04:55:36 +02:00
SomberNight
d3f65e24e1
kivy: warn user during "Send" if high fee (change condition)
Specifically, warning was previously triggered if fee > 1 mBTC;
now it is unified with Qt, warning is triggered if feerate > 600 sat/byte.
2019-05-17 20:10:10 +02:00
SomberNight
2adabfd918
kivy: fix history tab fiat values
follow-up 46f1fca7c3
2019-04-21 01:55:46 +02:00
SomberNight
8b2c586d30
post-storage_db-merge fixups 2019-03-01 14:14:30 +01:00
SomberNight
4ef3eda8da
util: mv create_URI to create_bip21_uri, and small clean-up 2019-02-20 21:19:03 +01:00
SomberNight
ef94af950c
wallet: try detecting internal address corruption 2018-12-12 20:50:53 +01:00
SomberNight
2eb72d496f
transaction: introduce TxOutput namedtuple 2018-08-01 19:10:08 +02:00
SomberNight
a29e2218c8
wallet: introduce namedtuples TxMinedStatus and VerifiedTxInfo 2018-07-31 17:10:15 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from gui/kivy/uix/screens.py (Browse further)