Commit graph

155 commits

Author SHA1 Message Date
SomberNight
a1d7d39f68
commands: add type hints for "wallet" param, and fix code rot found via 2019-09-21 02:14:22 +02:00
SomberNight
0b87ce426f
minor qt send tab fixes. notably 'send max' was broken
follow-up aaed594772
2019-09-16 02:54:32 +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
3d04399581 follow-up 7b828359c6 2019-09-12 13:12:48 +02:00
ThomasV
7b828359c6 simplify get_tx_fee 2019-09-12 12:26:49 +02:00
SomberNight
482605edbb wallet: organise get_tx_fee. store calculated fees. storage version 19. 2019-09-12 08:59:27 +02:00
ThomasV
5c83e8bd1c follow-up 241873f0a4 2019-09-12 08:58:58 +02:00
SomberNight
b138fff9a5
wallet: txi/txo small clean-up 2019-09-12 04:07:17 +02:00
SomberNight
241873f0a4
address_synchronizer.get_history now returns HistoryItem(NamedTuple)s 2019-09-12 04:06:51 +02:00
ThomasV
65b88dca86 return fees in history, show them in kivy GUI 2019-09-11 17:49:40 +02:00
SomberNight
9c31c1f970
wallet: address_is_old is now checked using SPV (during sync) 2019-09-10 18:26:09 +02:00
SomberNight
b2920db8b8
config: enforce that SimpleConfig is singleton
related: #5629
2019-09-10 18:01:10 +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
SomberNight
d1dea9343e
wallet: address_is_old minor clean-up
also, synchronize was defined twice in AddressSynchronizer
2019-09-09 01:34:29 +02:00
ThomasV
e5ff4fc7cd fix #5605 2019-09-06 13:43:00 +02:00
ThomasV
28da62f51b add PayServer settings to settings_dialog 2019-09-05 14:43:27 +02:00
ThomasV
466c2bd293 for now, use PR_PAID for onchain unconfirmed 2019-09-05 11:33:09 +02:00
ThomasV
128285a050 http server: add ssl and bip70 signed requests 2019-09-05 10:57:50 +02:00
SomberNight
1bd9b3a66a
commands: fix "restore" cmd
Previously commands did not run on the asyncio thread but now they do.
"restore" was polling like "while 1: time.sleep()", blocking the event loop.

Now "restore" does not sync the wallet; which is actually cleaner
as previously this wallet would never get unloaded from the daemon (syncing forever).

This is also symmetric with the "create" cmd which also does not try to sync with the network.

However now it became difficult to write a script that restores a wallet and wants to wait
until it gets synced. Workaround for now is to poll with "list_wallets" whether it's synced.

We could create a new command that blocks until the loaded wallet gets synced.
2019-09-04 20:15:54 +02:00
SomberNight
a42a773d19
storage: replace STO_EV_* ints with IntEnum 2019-09-04 13:31:49 +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
SomberNight
ff94240139
qt receive tab: fix on-chain pay.requests without amount 2019-09-03 18:33:49 +02:00
SomberNight
073a09f926
wallet/keystore: small inheritance clean-up 2019-09-03 16:24:05 +02:00
SomberNight
ab76a1fe5b
wallet.add_hw_info: also store "is_change" in output_info
as it seems every consumer wants to know this and has its own hacks to
figure it out
2019-09-03 14:34:10 +02:00
SomberNight
ac329797e0
wallet.add_hw_info: minor clean-up 2019-09-03 14:20:00 +02:00
ThomasV
d5691129bb
Merge pull request #5604 from MrNaif2018/master
Fix for onchain_history summary building
2019-09-02 18:35:23 +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
MrNaif2018
1dab0aa719
Fix for onchain_history summary building 2019-09-02 16:24:08 +03:00
ThomasV
7866caf2a7 minor fix: ensure request amount is not None 2019-08-26 16:59:38 +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
e584a7451c simplify tx history: do not use separate columns for lightning 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
2ec82433b4 wallet: add lnworker in constructor for CLI 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
730be17aba Use separate lightning nodes for gossip and channel operations. 2019-08-20 09:03:11 +02:00
ThomasV
7a51f034e4 add future transactions to address synchronizer 2019-08-20 09:03:11 +02:00
ThomasV
e6d680ec1b instanciate LNWorker without Network 2019-08-20 09:03:11 +02:00
ThomasV
08448fd2f0 add lnworker in start_network 2019-08-20 09:03:10 +02:00
ThomasV
21ee6f6965 asyncio: do not set event loop from wallet 2019-08-20 09:03:10 +02:00
Janus
18963405ee lightning: remove hub based approach, port qt gui to lnbase 2019-08-20 09:03:09 +02:00
Janus
9617447a0f lnbase: add lnbase_test 2019-08-20 09:03:09 +02:00
Janus
98f6f67c6b lightning: misc patches, launch asyncio loop on separate thread 2019-08-20 09:03:09 +02:00
Christian Clauss
e34afd62ce Travis CI: Use flake8 to find Python syntax errors and undefined names (#5467) 2019-08-11 22:35:23 +00:00
SomberNight
1c75d939d9
commands: change API of "make_seed" and "create" commands
instead of "segwit" boolean, take a "seed_type" optional arg
default seed_type to "segwit"
previously these commands created legacy seeds by defalt
2019-08-09 22:02:01 +02:00
SomberNight
a10dc04b28
wallet: fix offline hw wallet signing when not specifying --offline
closes #5532
2019-07-29 13:27:37 +02:00
SomberNight
8a1052330d
wallet: loosen bump_fee sanity check further
fixes #5502
2019-07-10 16:35:40 +02:00
SomberNight
cc9ad3ae90
wallet: fix restore_wallet_from_text edge case
closes #5490
2019-07-05 19:27:44 +02:00