Commit graph

3135 commits

Author SHA1 Message Date
ThomasV
ef5ad5f22f extend 'add_peer', 'list_peers' commands to gossip 2020-04-16 12:39:12 +02:00
ThomasV
c454564ed6 sql_db: do not require network object 2020-04-16 10:58:40 +02:00
SomberNight
82da581d45
lnworker: clear peer retry times if proxy settings change
maybe there were failures due to the previous proxy details being incorrect
2020-04-15 22:47:14 +02:00
SomberNight
95fa5d37c3
lnworker.peers: follow-up b5811e8072
somehow I forgot writes...
2020-04-15 22:41:16 +02:00
SomberNight
223b62554e
lntransport: use network proxy if available
fixes #4824
2020-04-15 21:44:09 +02:00
SomberNight
b5811e8072
lnworker.peers: fix threading issues 2020-04-15 21:43:58 +02:00
SomberNight
47ab8f8dc5
daemon.on_stop: adapt to python 3.8
(py3.8 has breaking changes re asyncio.CancelledError and asyncio.TimeoutError)

follow-up 308517d473
2020-04-15 19:34:52 +02:00
SomberNight
1600241b02
fix tests: follow-up prev few commits 2020-04-15 17:39:39 +02:00
SomberNight
7257172e1c
NetworkRetryManager: add random noise to time 2020-04-15 17:24:10 +02:00
SomberNight
76f0ad3271
util: add NetworkRetryManager, a baseclass for LNWorker and Network 2020-04-15 17:24:07 +02:00
SomberNight
90cb032721
lnworker: implement exponential backoff for retries 2020-04-15 17:24:04 +02:00
SomberNight
86b29603cb
network: (trivial) rename field to indicate private 2020-04-15 17:24:00 +02:00
SomberNight
ac749f3a19
network: introduce NUM_STICKY_SERVERS 2020-04-15 17:23:57 +02:00
SomberNight
34e3e48ba5
network: rm server_queue
it's no longer needed; now it was just an extra level of indirection
2020-04-15 17:23:54 +02:00
SomberNight
8baa79be88
network: implement exponential backoff for retries 2020-04-15 17:23:50 +02:00
SomberNight
cf1f2ba4dc
network: replace "server" strings with ServerAddr objects 2020-04-15 17:23:47 +02:00
ThomasV
ef2ff11926 fix tests (follow-up prev commit) 2020-04-14 18:35:50 +02:00
ThomasV
9224404108 Move callback manager out of Network class 2020-04-14 18:29:51 +02:00
ThomasV
73325831b7 run lnworker.main_loop directly on the event loop 2020-04-14 18:28:23 +02:00
Luke Childs
1d667fe932
Hard fail on bad server-string (#6086)
* If server-string can't be parsed, fall back to localhost.

Co-Authored-By: Luke Childs <lukechilds123@gmail.com>

Co-authored-by: ghost43 <somber.night@protonmail.com>
2020-04-14 12:15:28 +00:00
SomberNight
40dc54e8b8
macOS: duplicate Qt "Preferences" menu item
There is a standardised location along with reserved hotkey for "Preferences"
in applications on macOS. Let's put *another* preferences menu item there.

The duplicate items ensure that
- an electrum user coming from a different OS,
- a macOS user used to the standardised preferences location,
will both find "Preferences" easily.
2020-04-13 19:53:52 +02:00
SomberNight
54e1520ee4
ln: check if chain tip is stale when receiving HTLC
if so, don't release preimage / don't forward HTLC
2020-04-13 17:04:27 +02:00
SomberNight
12283d625b
(trivial) rename lnchannel.channel_states to ChannelState 2020-04-13 16:02:05 +02:00
SomberNight
8e8ab775eb
lnchannel: make AbstractChannel inherit ABC
and add some type annotations, clean up method signatures
2020-04-13 15:57:53 +02:00
ThomasV
821431a239 lnpeer: move ping_if_required away from message_loop
If our connection dies because we went to sleep, message_loop
will stall and ping_if_required will never be called.
2020-04-13 11:34:58 +02:00
ThomasV
bddb0bfcdd Do not wait wallet sync to reestablish channel (revert e32807d29d). 2020-04-13 11:30:52 +02:00
SomberNight
fe86f91110
adapt to new aiohttp_socks: fix deprecation warnings
...\electrum\electrum\util.py:1096: DeprecationWarning: SocksConnector is deprecated. Use ProxyConnector instead.
  connector = SocksConnector(
...\Python38\site-packages\aiohttp_socks\proxy\socks5_proxy.py:37: DeprecationWarning: Parameter family is deprecated and will be ignored.
  super().__init__(
2020-04-13 05:00:26 +02:00
SomberNight
10c358dd38
bitbox02: rm plugin.get_client method: just use default impl 2020-04-12 15:34:19 +02:00
SomberNight
dda20583c2
bitbox02: rm BitBox02Client.label override
if placeholder anyway, just use base impl
(alternatively we should list it in electrum.plugin.PLACEHOLDER_HW_CLIENT_LABELS)
2020-04-12 15:34:19 +02:00
SomberNight
e830ef309f
hww: factor out part of hid scan code to HW_PluginBase
so that bitbox02 can override it
2020-04-12 15:34:19 +02:00
SomberNight
66c264f613
bitcoin.py: change API of address_to_hash 2020-04-12 15:34:19 +02:00
SomberNight
cc4aa1812d
rm some unused imports 2020-04-12 15:34:19 +02:00
SomberNight
ffe3cef21a
bitbox02: don't run show_xpub on GUI thread 2020-04-12 15:34:19 +02:00
SomberNight
0268b63fcb
bitbox02: rm some dead code 2020-04-12 15:34:19 +02:00
SomberNight
15102855c1
bitbox02: fix pairing_dialog 2020-04-12 15:34:19 +02:00
SomberNight
c0c3627bd2
bitbox02: adapt to updated master 2020-04-12 15:34:19 +02:00
TheCharlatan
a4fe14bb82
BitBox02 Electrum plugin support
This commit adds support for the BitBox02 hardware wallet.
It supports both single and multisig for the electrum gui wallet.

To use the plugin a local installation of the BitBox02 python library is
required. It can be found on PiPy under the name 'bitbox02' and can be
installed from the bitbox02-firmware repository in the py/bitbox02
directory.

All communication to and from the BitBox02 is noise encrypted, the keys
required for this are stored in the wallet config file under the
bitbox02 key.

The BitBox02 registers a multisig configuration before allowing
transaction signing. This multisig configuration includes the threshold,
cosigner xpubs, keypath, a variable to indicate for mainnet and testnet,
and a name that the user can choose during configuration registration.
The user is asked to register the multisig configuration either during
address verification or during transaction signing.

The check the xpub of the BitBox02 for other hardware wallets, a button
is added in the wallet info dialog.

The wallet encryption key is fetched in a separate api call, requiring a
slightly tweaked override version of the wallet encryption password.
2020-04-12 15:34:37 +02:00
ThomasV
bfffc7cb1e Rename 'On-chain' button, add tooltips (see #6053) 2020-04-12 12:57:07 +02:00
ThomasV
27949cb0e5 add list_peer command. (fix #6057) 2020-04-12 12:48:44 +02:00
ThomasV
99f933401a add more logging shortcuts 2020-04-12 12:30:59 +02:00
SomberNight
9a88c13b3d
translations: add note that f-strings cannot be translated
and replace current usage
2020-04-11 16:33:45 +02:00
SomberNight
08118ca167
qt wizard: tweak GoBack behaviour to recalc inputs to previous dialog
follow-up f13f46c555

When on dialog n user presses "Back",
- previously, we went back to when dialog n-1 appeared
- now, go back to just after dialog n-2 finishes
This way, any calculations between when dialog n-2 finishes and
dialog n-1 appears will rerun, potentially populating dialog n-1 differently.

Namely if the user presses back on the confirm_seed_dialog, we want to
go back to the show_seed_dialog but with a freshly generated seed.
2020-04-11 15:50:12 +02:00
ThomasV
e2544b893a rm dead code: wallet.wait_until_synchronized 2020-04-11 15:26:29 +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
e50f6d29ed export channel backup from kivy gui 2020-04-10 20:04:24 +02:00
ThomasV
74517c88ad do not use short_channel_id as state, use channel state for that.
display it as soon as the funding tx is mined.
2020-04-10 15:10:50 +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
SomberNight
b6bac0182f
wizard hww: use exception handling to choose hw device again
- no need to pass args, caller knows what it wanted
- avoids deepening the call stack on every rescan
  (nicer tracebacks, no stack overflow)
2020-04-09 19:45:45 +02:00
SomberNight
71eed1d4cb
wizard: (trivial) add show_error to base class, document API 2020-04-09 19:45:42 +02:00