Commit graph

189 commits

Author SHA1 Message Date
bitromortac
3c3a59c517 cli: remove enable/disable lightning 2020-10-22 18:05:51 +02:00
SomberNight
4b6c86ecbe
wallet: make labels private, and access to need lock
e.g. labels plugin iterated over wallet.labels on asyncio thread while user could trigger an edit from Qt thread
2020-10-13 18:57:55 +02:00
SomberNight
83e61d6743
cli: allow specifying --wallet at any arg position, as before
Before commit 46ffab0b55 all of these used to work:
./run_electrum -o signmessage tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" -w ~/.electrum/testnet/wallets/test_segwit_2 --testnet
./run_electrum -o signmessage -w ~/.electrum/testnet/wallets/test_segwit_2 tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" --testnet
./run_electrum -w ~/.electrum/testnet/wallets/test_segwit_2 -o signmessage tb1qeh090ruc3cs5hry90tev4fsvrnegulw8xssdzx "asdasd" --testnet
Since then, the last one no longer works.

Related: 9d2ede8796
2020-10-05 18:02:37 +02:00
bitromortac
c422d7c671
commands: use channeldb.to_dict for dumpgraph 2020-10-02 06:58:10 +02:00
bitromortac
193b17f0e4
util: move json_normalize to util 2020-09-24 07:32:18 +02:00
MrNaif2018
ba649fa8ab
Added for_broadcast argument to payto/paytomany (#6532)
The payto command now takes a flag "addtransaction" whether the returned transaction should be added to the wallet history.
Previously payto did not have a side-effect, and as the flag is opt-in, that will stay the default.

closes #6529
2020-09-01 19:25:36 +00:00
Johannes Zweng
2c7da6afde
add missing wallet.save_db() after adding or rm'ing payment requests (#6435) 2020-09-01 17:24:51 +00:00
SomberNight
54d2fa0e7d
commands: fix signtransaction cmd
fixes #6502
2020-08-26 19:48:35 +02:00
SomberNight
29534dcf3d
commands: allow setting custom 'nsequence' in 'serialize' cmd
closes #6297
2020-06-28 17:26:52 +02:00
ThomasV
b0c390e231 wallet.clear_requests. fixes #6279 2020-06-26 09:47:16 +02:00
SomberNight
d5f368c584
LN invoices: support msat precision
fixes #6250
2020-06-22 22:48:13 +02:00
ThomasV
5fa09970b6 swaps: move fee logic to swap_manager, fix command line 2020-06-18 14:28:40 +02:00
ThomasV
17ff6ffa08 submarine_swaps: add SwapManager 2020-06-18 14:28:40 +02:00
ThomasV
1b1c7d1f9e submarine swaps: create refund transaction 2020-06-18 14:28:40 +02:00
ThomasV
756dd8eb66 submarine swaps: add forward swaps 2020-06-18 14:28:40 +02:00
ThomasV
1e67e55303 submarine swaps, initial implementation:
- server uses Boltz API (https://docs.boltz.exchange/en/latest/)
 - reverse swaps only
 - command-line only
2020-06-18 14:28:40 +02:00
SomberNight
61ccc1ccd3
config: allow changing "skipmerklecheck" at runtime
requested by shesek for "bwt"
2020-06-08 16:10:47 +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
ThomasV
717d112b26 Move create_transaction logic from commands to wallet 2020-05-21 12:08:46 +02:00
SomberNight
9baaf1afda
commands: make 'wallet'-mangling in decorator less obscure, and fixes
- some commands expect a 'wallet_path' arg, while others expect 'wallet'
- 'wallet_path' in the end is supposed to be a str,
  'wallet' in the end is supposed to be an Optional[Abstract_Wallet]
- initially, in the decorator, 'wallet' can be a str, in which case
  the decorator replaces it with an Abstract_Wallet (from the daemon)
- Previously the decorator sometimes converted 'wallet_path' to 'wallet'.
  This was because when called from the CLI it was always given 'wallet_path' (and never 'wallet),
  while when called from JSON-RPC it was given either 'wallet' or 'wallet_path' (depending on command).
  Now, the CLI also behaves as JSON-RPC, and hence 'wallet_path' and 'wallet' are fully separate.
- A bug is fixed where, when a command that only optionally takes a 'wallet' (such as gettransaction),
  was called from the JSON-RPC with the arg present, it raised; and when called from CLI with the arg present
  the arg was not actually passed to the command.
- A bug is fixed where if one command calls another command (that both take a 'wallet'),
  it would raise (due to assuming 'wallet' is str and needs to be converted to Abstract_Wallet).
  This fixes #6154.

-----

$ ./run_electrum --testnet daemon -d
$ ./run_electrum --testnet load_wallet -w ~/.electrum/testnet/wallets/default_wallet

$ curl --data-binary '{"id":"curltext","jsonrpc":"2.0","method":"gettransaction","params":{"txid":"9f43ff71ea2594873e4e7d15e61254a3661ff2df1af76325c854d9aa199550ce"}}' http://user:pass@127.0.0.1:7777
{"jsonrpc": "2.0", "result": "0200000001caaac6b5eb916e3067d0224f942fb331ce1dcfb4031cfb479e7941dcf95e409801000000fdfe0000483045022100e2a508bb78c2172eb03f081a342454ba1d24669e959700973b1a742a4fedd0c302203174e06feda265031cf9aa0364d4a4eafb71b0c0a62e76be7795cfbb307b677a01483045022100d0e14564838fac754395158741d64c73da2b86e7900dfdc6a63c7492b232ba130220778e7e7c21d94ebcd340057302aeff7e9a797a3aa3e0ac4884e9ff27339ea6e9014c69522102091f0b4d8ab30016a5d1c088249e02883fad8160f06fa53588ad8598650a3e6221035f2f8263bb3608d6cc4ee03bd4cb8d65c4d70af71049f05fbfee4978832a1fd22103fe42dab58718ea0413f7c8de693cdeee22ce19b1dc34c0bbdd7a48245465c5a253aefdffffff01cb9f0700000000001976a914c13fd6294d1be7b9410a5538f4b4ef10fc594ee788ac802c1800", "id": "curltext"}

$ curl --data-binary '{"id":"curltext","jsonrpc":"2.0","method":"gettransaction","params":{"txid":"9f43ff71ea2594873e4e7d15e61254a3661ff2df1af76325c854d9aa199550ce", "wallet":"~/.electrum/testnet/wallets/default_wallet"}}' http://user:pass@127.0.0.1:7777
{"jsonrpc": "2.0", "error": {"code": -32000, "message": "'str' object has no attribute 'db'"}, "id": "curltext"}
2020-05-14 16:33:02 +02:00
ThomasV
8fb79196ba add_lightning_request command: return request object 2020-05-11 17:52:04 +02:00
ThomasV
b891d3dc85 new command: get_ssl_domain 2020-05-09 10:33:18 +02:00
ThomasV
7b44e27087 lnpay: return payment log, increase timeout 2020-05-05 18:32:43 +02:00
ThomasV
a5a5048d53 lnpay: save invoice 2020-05-02 17:26:02 +02:00
Luke Childs
ca1046bce2
Add --serverfingerprint option (#6094)
* Add --fingerprint option

* Simplify conditional checks

* Improve warning wording

* Throw error instead of logging and returning

* --fingerprint => --serverfingerprint

* Only run fingerprint checks against main server

* Throw error if --serverfingerprint is set for a non SSL main server

* Fix linting errors

* Don't check certificate fingerprint in a seperate connection

* Disallow CA signed certs when a fingerprint is provided

* Show clear error and then exit for Qt GUI users

* Remove leading newlines from error dialog

* Always check is_main_server() when getting fingerprint

* Document how to generate SSL cert fingerprint
2020-04-24 14:11:40 +00:00
SomberNight
e2ae44beb9
commands: "notify" cmd: stop watching addr if called with empty URL
closes #5881
2020-04-24 15:34:55 +02:00
ThomasV
0b6ae1dbff fix #6101 2020-04-20 18:55:07 +02:00
ThomasV
4d01a550c4 fix #6103: local config contains remote reserve 2020-04-20 18:48:41 +02:00
SomberNight
b2cfaddff2
network.NetworkParameters: merge host+port+protocol into "server" field 2020-04-16 21:19:45 +02:00
ThomasV
ef5ad5f22f extend 'add_peer', 'list_peers' commands to gossip 2020-04-16 12:39:12 +02:00
ThomasV
27949cb0e5 add list_peer command. (fix #6057) 2020-04-12 12:48:44 +02:00
ThomasV
312ef15cd6 fix #6056 2020-04-11 12:02:38 +02:00
ThomasV
7a11c05916 fix #6075 2020-04-11 10:56:43 +02:00
ThomasV
8f41aeb783 Replace wallet backup with channel backups
- channels can be backed up individually
 - backups are added to lnwatcher
 - AbstractChannel ancestor class
2020-04-10 14:45:23 +02:00
ghost43
b31efdc3e7
Merge pull request #6076 from JeremyRand/initial-download-exception
Use specific Exception when chain isn't synced
2020-04-08 08:34:40 +00:00
JeremyRand
40389a21b6
Use specific Exception when chain isn't synced
Makes it easier for calling code to know what error happened.
2020-04-08 03:09:08 +00:00
SomberNight
900a7631cf
commands: add new cmd "getprivatekeyforpath" to export a WIF for a path
related: #6061
2020-03-31 05:50:18 +02:00
JeremyRand
72de433f5c
Commands: clarify description of getservers
The previous description made it sound like it returned the list of
currently connected servers; this clarifies that it's only a list of
candidate servers to connect to (no guarantee that they are all currently
connected).
2020-03-30 22:50:25 +00:00
SomberNight
777e350fae
lnchannel: partly fix available_to_spend
we were looking at inconsistent ctns
and we were looking at the wrong subject's ctx

all the FIXMEs and TODOs here will still warrant some attention.

(note that test_DesyncHTLCs was passing incorrectly:
the "assertRaises" was catching a different exception)
2020-03-26 09:04:55 +01:00
interrupt00
df700ca96a Document how to disable proxy 2020-03-17 23:23:17 +01:00
ThomasV
d5469b7eb5 fix #6037 2020-03-16 14:31:22 +01:00
ThomasV
8480989fb7 follow-up 17a893441a: satoshis 2020-03-06 10:07:36 +01:00
ThomasV
34e236c9b6 CLI: show channel reserves and unsettled balances. fixes #5817 2020-03-06 09:57:37 +01:00
SomberNight
2aebcc5e26
commands: gate get_channel_ctx behind --iknowwhatimdoing 2020-03-05 17:27:43 +01:00
ThomasV
89fa9b5090
Merge pull request #5898 from leo-lb/plausible-deniability-config
Add command line option to forget config on exit.
2020-03-03 11:50:04 +01:00
SomberNight
660d7d137c
commands: add changegaplimit and getminacceptablegap cmds
There are some legitimate use-cases for changing the gap limit,
so just as it has already been possible to do in the GUI (using the console only! don't expose this to mere mortals.),
now CLI/RPC users have this exposed too.

The "changegaplimit" command will always raise unless invoked with the --iknowwhatimdoing option.

closes #5882

e.g.:
$ curl --data-binary '{"id":"curltext","jsonrpc":"2.0","method":"changegaplimit","params":{"new_limit": 30, "iknowwhatimdoing": true, "wallet":"~/.electrum/testnet/wallets/test_segwit_2"}}' http://user:password@127.0.0.1:7777
$ ./run_electrum --testnet changegaplimit 30 --iknowwhatimdoing -w ~/.electrum/testnet/wallets/test_segwit_2
2020-03-02 19:07:59 +01:00
ThomasV
077f778632 Replace lightning_settle_delay with enable_htlc_settle (asyncio.Event) 2020-02-28 10:15:28 +01:00
ThomasV
8730fa3f75 return preimage in lnpay. fixes #5794 2020-02-23 12:40:40 +01:00
ThomasV
67d0e780b3 remove double definition of lightning_history. fixes #5984 2020-02-23 11:59:34 +01:00
ThomasV
9451ca9568 move list_channels to commands.py 2020-02-20 10:30:30 +01:00