Commit graph

12543 commits

Author SHA1 Message Date
ThomasV
2adbbee5fe Add extra state to distinguish shutdown negotiation from post-
negotiation, where channel should not be reestablished. See #6182
2020-05-29 18:00:52 +02:00
ThomasV
680502cfb8 Qt: copy request to clipboard when it is created 2020-05-29 09:57:25 +02:00
ThomasV
3bf2641ce8 kivy: remove test_seed and test_xpub. fixes #6146 and #5925 2020-05-29 08:59:14 +02:00
Jin Eguchi
6339afee3b
appimage: update openssl (#6186) 2020-05-29 00:30:20 +00:00
ThomasV
8e3ee73daf
Merge pull request #6134 from SomberNight/202004_ln_fundingtx_forbid_bump_cjoin
wallet: disallow fee-bumping/coinjoining ln funding tx
2020-05-27 18:37:04 +02:00
ThomasV
6aa337c618 fix #6176 2020-05-27 18:13:30 +02:00
ThomasV
c035bfcc46 Qt: show fee combo next to fee slider, and remove it from settings 2020-05-26 18:34:48 +02:00
ThomasV
959af0065b follow-up previous commit: cleanup imports 2020-05-26 16:06:15 +02:00
ThomasV
7490787d38 follow-up previous commit 2020-05-26 15:55:47 +02:00
ThomasV
1c436bbc22 move units and amount formatting to simple_config 2020-05-26 15:49:28 +02:00
SomberNight
4d8fcded4b
qt plugins dialog: fix caching "settings" button
shesek reported on IRC:
> the button widget for opening plugins configuration gets cached in `settings_widgets`
> even after the plugin is disabled and re-enabled, which causes it to call `settings_dialog()`
> on the previous plugin instance that got unloaded instead of the new one.
2020-05-26 00:54:22 +02:00
SomberNight
ac63444cfc
wallet: better handle used change addresses reverting to unused
If a used/reserved change address became unused/unreserved, it would not
get offered for usage by wallet until app restart.
Make the used->unused transition less likely by requiring 3 confirmations
(instead of considering even local/unconfirmed txs for 'used');
and avoid removing reserved addresses from the pool altogether.
2020-05-25 17:42:11 +02:00
SomberNight
c14a704082
wallet: fix minor locking thing in set_reserved_state_of_address
follow-up 6040e953a3
2020-05-25 17:34:52 +02:00
SomberNight
24221f8fca
plugins: fix labels plugin FIXME re "just enabled plugin" 2020-05-25 17:31:13 +02:00
SomberNight
cdecc4e3fa
wallet: increase gap limit for change (6 -> 10)
We are now using change addresses for the channel SRK to_remote outputs
(and reserving these change addresses). (see prev commits)
Note that every channel open we initiate typically uses two change addresses:
- one for the SRK to_remote output, and
- one for the funding tx change output (assuming there is change).
2020-05-22 17:19:58 +02:00
SomberNight
530a446172
follow-up prev: don't reuse funding tx change address for static_remotekey
see comment in code
2020-05-22 17:19:55 +02:00
SomberNight
6040e953a3
wallet: implement reserving addresses, and use it for LN SRK to_remote
- Use change addresses (instead of receive) for the static_remotekey to_remote outputs,
  and reserve these to greatly reduce the chance of address-reuse
- Use change addresses (instead of receive) for LN channel sweep addresses.
  Note that these atm are not getting reserved.
2020-05-22 17:19:51 +02:00
SomberNight
6457bb141d
wallet: (trivial) rename check_address 2020-05-22 17:19:48 +02:00
SomberNight
f8c574b699
wallet: (fix) get_receiving_address must always return an addr
- also, disallow deleting last address from an imported wallet (fixes #3254, fixes #4833)
- also, set LNBackups.sweep_address lazily, as during fresh wallet creation
  there are no addresses in the wallet at that point yet! see trace below.

Traceback (most recent call last):
  [...]
  File "...\electrum\electrum\tests\test_commands.py", line 112, in test_export_private_key_deterministic
    wallet = restore_wallet_from_text('bitter grass shiver impose acquire brush forget axis eager alone wine silver',
  File "...\electrum\electrum\wallet.py", line 2575, in restore_wallet_from_text
    wallet = Wallet(db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2502, in __new__
    wallet = WalletClass(db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2346, in __init__
    Deterministic_Wallet.__init__(self, db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 2147, in __init__
    Abstract_Wallet.__init__(self, db, storage, config=config)
  File "...\electrum\electrum\wallet.py", line 261, in __init__
    self.lnbackups = LNBackups(self)
  File "...\electrum\electrum\lnworker.py", line 1401, in __init__
    self.sweep_address = wallet.get_receiving_address()
  File "...\electrum\electrum\wallet.py", line 1498, in wrapper
    addr = func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet.py", line 1520, in get_receiving_address
    raise Exception("no receiving addresses in wallet?!")
Exception: no receiving addresses in wallet?!
2020-05-22 16:25:33 +02:00
SomberNight
9657e927a7
wallet: (trivial) define import/delete_address in Abstract_Wallet 2020-05-22 16:17:41 +02:00
SomberNight
b9f20d2c79
qt locktimeedit: fix max timestamp platform-dependent crash
fixes #6170
2020-05-21 21:03:41 +02:00
SomberNight
446f21c206
qt first-time network setup: fix edge case
previously, consider following flow:
- user selects "Select server manually"
- "next"
- network dialog is shown, user leaves everything at default
- "next"
- we would not save the "auto_connect" key, and hence the first-time
  network setup will be shown during the next app start again
2020-05-21 19:27:46 +02:00
SomberNight
dfb3138d87
fix #6168: "'MySortModel' object has no attribute 'item'" 2020-05-21 19:16:19 +02:00
ThomasV
717d112b26 Move create_transaction logic from commands to wallet 2020-05-21 12:08:46 +02:00
ThomasV
782f9ed273 lnwatcher: use generic callbacks 2020-05-20 13:49:44 +02:00
SomberNight
7da8c2dfe5
qt/kivy: show warning when sending tx with high fee/amount ratio
related: #6162
2020-05-15 20:00:59 +02:00
SomberNight
937c0f36ae
kivy: fix some bugs when paying 'max'
fixes: #6164
2020-05-15 20:00:56 +02:00
SomberNight
eba3fa03ee
kivy: confirm all actions even if there is no PIN set
eh.. I've just consolidated hundreds of testnet UTXOs by accident
2020-05-15 19:11:31 +02:00
SomberNight
1ac41b33a2
qt ConfirmTxDialog: (fix) allow sending tx with high feerate 2020-05-15 17:09:25 +02:00
SomberNight
efc5deb06e
qt addresses list: custom sort order for "Type" and "fiat balance" cols
fixes #4920
fixes #5641
2020-05-15 15:32:27 +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
7d0703fc4a
fix mac build: follow-up aac770404f 2020-05-14 20:58:54 +02:00
SomberNight
2a4b516f16
qt receive tab: fix refresh bug on macOS
related: #4777
2020-05-14 20:24:21 +02:00
SomberNight
587f8df8ad
binaries: update base docker image for wine/appimage 2020-05-14 20:24:17 +02:00
SomberNight
aac770404f
mac build: pin hashes of more build dependencies
namely pyinstaller
2020-05-14 20:24:14 +02:00
SomberNight
d9b4270035
mac build: bump libusb version 2020-05-14 20:24:11 +02:00
SomberNight
7143e9199f
binaries: bump python version (3.7.6->3.7.7) 2020-05-14 20:24:07 +02:00
SomberNight
55c8216738
binaries: update bundled PyQt version: 5.11.3 -> 5.14.2
Now that we increased the min supported macOS version re #6128 anyway.
Per https://github.com/spesmilo/electrum/issues/3685#issuecomment-508556343,
Qt 5.14 needs at least macOS 10.13
2020-05-14 20:24:03 +02:00
SomberNight
a4bec80efe
(trivial) log Qt version at startup 2020-05-14 19:15:50 +02:00
SomberNight
f9de6a5354
tests: lnpeer: make debug htlc failure hooks more uniform 2020-05-14 19:15:32 +02:00
SomberNight
2b0ed9f406
(trivial) lnpeer: rm @log_exceptions from htlc_switch 2020-05-14 19:15:29 +02:00
SomberNight
095464b620
mac build: conform to macOS 10.15 Gatekeeper requirements
fixes #6128

some of this is based on:
e1354632d2/scripts/package/macos-notarize-app.sh
1eb8b71e7d
24e44e9784
5abec73eee
2020-05-14 17:09:08 +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
SomberNight
21e637f543
network: validate server peers sent by main server
Data returned by the main server for request "server.peers.subscribe"
is of course untrusted input. Previously if it contained e.g. invalid port numbers
or IP addresses, it could kill the whole network taskgroup.
(this might have only affected master and not released versions,
which would only raise exceptions once the client actually tried to connect to an invalid host/port)
2020-05-13 19:28:35 +02:00
SomberNight
6d1acc929a
kivy: fix "choose from peers" in network server-select popup
follow-up 9e57ae630b
fixes #6161
2020-05-13 19:05:07 +02:00
SomberNight
41aa50a3f3
coldcard: log exception traceback in create_client
related: https://github.com/Coldcard/ckcc-protocol/pull/9
2020-05-13 18:11:53 +02:00
ThomasV
a3332dc72a show watchtower db size in GUI 2020-05-13 15:13:09 +02:00
ThomasV
594f13b6f7 appimage: update libudev-dev in Dockerfile 2020-05-13 10:55:08 +02:00
ThomasV
d3fb68575d daemon.py: Add authentication to Watchtower.
Define abstract class AuthenticatedServer
2020-05-12 10:12:30 +02:00
ThomasV
2fed218452 follow-up prev commit (fix regtest) 2020-05-12 09:22:39 +02:00