Commit graph

139 commits

Author SHA1 Message Date
Madiator2011
43a67ef148 Upgrade Electrum base to 3.3.8 2020-02-17 23:42:13 +01:00
ThomasV
e1ce3aace7 Separate db from storage
- storage is content-agnostic
 - db and storage are passed to wallet contructor
2020-02-10 17:45:23 +01:00
SomberNight
3835157f41
cli: history commands: only json-encode once
closes #5868
closes #5931
2020-02-04 17:56:52 +01:00
ThomasV
4ec86d36a8 faster and improved regtests
- print the test name before each test
 - start only needed agents (alice, bob, carol)
 - set settle_delay using setconfig instead of restarting daemon
 - test the watchtower ctn in test_watchtower
2020-02-02 15:07:28 +01:00
SomberNight
ad5c6284c4
commands/jsonrpc: fix specifying "wallet" to commands that need it 2019-12-21 07:00:30 +01:00
SomberNight
9b28f6df7b
wallet: encrypt storage by default
notably, now also in kivy
2019-12-19 14:22:47 +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
06589df812 simplify add_transaction 2019-11-23 12:46:43 +01:00
SomberNight
c31fa059fe
cli: clear up "rbf" arg for "payto" cmd in help text; and use eval_bool
related: #5791

(previously rbf was a str, and it was casted to a bool directly, i.e. only
the empty string "" evaluated as False)
2019-11-22 16:09:42 +01:00
SomberNight
420b1a6636
cli: load_wallet now auto-upgrades the WalletStorage when needed
previously it would bail out and just return False
2019-11-22 15:54:34 +01:00
SomberNight
3d88d6870c
cli: fix load_wallet for storage-encrypted wallets 2019-11-22 15:48:22 +01:00
ghost43
f2ca651dc4
Merge pull request #5775 from JeremyRand/resolver-wallet
Fix missing wallet argument to _resolver
2019-11-18 02:11:06 +00:00
JeremyRand
643bc9d802
Fix missing wallet argument to _resolver 2019-11-18 01:31:33 +00:00
ThomasV
78813dcb7d Pass make_tx function to ConfirmTxDialog
- allow 'spend max' when opening a channel (fixes #5698)
 - display amount minus fee when 'max' buttons are pressed
 - estimate fee of channel funding using a template with dummy address
2019-11-14 10:20:19 +01:00
SomberNight
85a4811742
transaction.tx_from_any: recognise even more types, and add tests 2019-11-08 15:01:18 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
f72bb03af6
commands: gettransaction cmd now tests txid before returning tx
thanks for @JeremyRand
ref #5660
2019-11-02 05:46:52 +01:00
ThomasV
a13cea6f8a add remove_lightning command 2019-10-14 11:18:57 +02:00
ThomasV
90ce9f195b Allow user to enable lightning in the GUI. Make it a per-wallet setting. 2019-10-13 20:34:38 +02:00
SomberNight
04edad9984
config: no longer singleton. it is passed to Wallet.__init__
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
2019-09-22 20:46:01 +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
JeremyRand
7b91cd9cf4
Add from_coins arg to payto/paytomany
Fixes https://github.com/spesmilo/electrum/issues/5430
2019-09-21 20:07:16 +00:00
SomberNight
a1d7d39f68
commands: add type hints for "wallet" param, and fix code rot found via 2019-09-21 02:14:22 +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
SomberNight
1b332748c3
qt console: fix commands that do not expect a 'wallet' arg 2019-09-12 19:22:55 +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
SomberNight
ef5a5151e3
daemon: make 'wallets' dict private
especially as keys (paths) need to be standardized, this should not be exposed
2019-09-09 22:15:11 +02:00
ThomasV
103a37b0ca add wallet_path to kwargs in run_cmdline 2019-09-09 09:58:16 +02:00
ThomasV
46ffab0b55 remove --wallet option for daemon. fixes #3752 2019-09-09 06:28:54 +02:00
ThomasV
5e92f637a6 fix CLI exception handling 2019-09-06 12:38:13 +02:00
ThomasV
35b0b3a43c Fix CLI. Some commands require wallet_path. Return error on exception. 2019-09-06 11:06:08 +02:00
SomberNight
712c3f1248
commands: try to fix tests 2019-09-05 23:22:11 +02:00
SomberNight
58681e4d07
follow-up prev (commands) 2019-09-05 18:30:04 +02:00
ThomasV
9ec9e1760a CLI: always use the daemon's cmd_runner, and pass the 'wallet'
parameter explicitly to each command that requires it.
Previous code was relying on side effects to set the wallet.
This should fix #5614
2019-09-05 17:57:51 +02:00
ThomasV
128285a050 http server: add ssl and bip70 signed requests 2019-09-05 10:57:50 +02:00
SomberNight
9d65120e59
commands: fix "close_wallet" 2019-09-04 20:16:47 +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
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
7f870f5e09 replace daemon 'start' subdommand with -d 2019-09-02 19:04:08 +02:00
SomberNight
eb5033dfc6
commands: add feerate param to payto/paytomany 2019-09-01 17:52:02 +02:00
ThomasV
e79253b5e0 Syntax change: Require --offline to run commands without a daemon.
That makes the syntax less ambiguous. It also makes it possible to
implement a CLI that does not import all the electrum modules.
2019-08-31 09:24:00 +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
246cda2928 fix Flake8 tests 2019-08-20 09:03:12 +02:00
ThomasV
9cfeadea70 Turn daemon subcommands into RPCs 2019-08-20 09:03:12 +02:00
ThomasV
54257cbcca Rewrite JsonRPC requests using asyncio.
- commands are async
 - the asyncio loop is started and stopped from the main script
 - the daemon's main loop runs in the main thread
 - use jsonrpcserver and jsonrpcclient instead of jsonrpclib
2019-08-20 09:03:12 +02:00
SomberNight
6b1810f8dc commands.py: fix type of "timeout" arg
was str by default
2019-08-20 09:03:12 +02:00
ThomasV
e5286f7598 minor fix: always initialize Commands.lnworker 2019-08-20 09:03:12 +02:00
ThomasV
28b1569f28 (trivial) fix getbalance 2019-08-20 09:03:12 +02:00