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)
6 years ago
ThomasV
11aaa0b66f
Simplify services (watchtower, payserver):
...
- Do not expose services settings in GUI
- Use a single netaddress configuration variable.
6 years ago
SomberNight
9ac41be1e8
network: set .oneserver in __init__
...
fixes #6135
6 years ago
Luke Childs
cd199390e2
Use non-standard localhost port for server-string fallback ( #6087 )
...
* Use non-standard localhost port for server-string fallback
Co-authored-by: Luke Childs <lukechilds123@gmail.com>
6 years ago
SomberNight
9e57ae630b
network/gui: unify host/port input fields to single server str
...
This allows optionally specifying the protocol for the main server.
fixes #6095
fixes #5278
6 years ago
SomberNight
b2cfaddff2
network.NetworkParameters: merge host+port+protocol into "server" field
6 years ago
SomberNight
adc3784bc2
network: allow mixed protocols among interfaces
...
Previously all the interfaces used either "t" or "s".
Now the network only tries to use "s" for all interfaces, except for
the main interface, which the user can manually specify to use "t".
(so e.g. if you run with "--server localhost:50002:t", the main server will use "t",
but all the rest will use "s")
6 years ago
SomberNight
76f0ad3271
util: add NetworkRetryManager, a baseclass for LNWorker and Network
6 years ago
SomberNight
86b29603cb
network: (trivial) rename field to indicate private
6 years ago
SomberNight
ac749f3a19
network: introduce NUM_STICKY_SERVERS
6 years ago
SomberNight
34e3e48ba5
network: rm server_queue
...
it's no longer needed; now it was just an extra level of indirection
6 years ago
SomberNight
8baa79be88
network: implement exponential backoff for retries
6 years ago
SomberNight
cf1f2ba4dc
network: replace "server" strings with ServerAddr objects
6 years ago
ThomasV
9224404108
Move callback manager out of Network class
6 years ago
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>
6 years ago
SomberNight
8be94076b5
network: update tx broadcast error msgs whitelist
...
fixes #6052
6 years ago
SomberNight
a7c02c770d
follow-up prev: network.interface might be None
6 years ago
ThomasV
133d74adfb
fee estimates: use median if auto-connect
6 years ago
ThomasV
0d160cceea
Qt: test if lightinng is running
6 years ago
SomberNight
88650ed8d6
network UntrustedServerReturnedError: add "DO NOT TRUST..." tag
6 years ago
SomberNight
ce81957d25
blockchain: move init_headers_file from network.py to blockchain.py
...
and don't run it every time the network restarts
6 years ago
SomberNight
b21bcf5977
taskgroups: don't log CancelledError
6 years ago
SomberNight
ed234d3444
rename all TaskGroup() fields to "taskgroup"
...
for consistency
6 years ago
ThomasV
36f32651cc
Define network.try_broadcasting() method.
...
Use it when rebroadcasting a force-close tx,
because the channel state is already set.
6 years ago
ThomasV
cded582fe9
Start watchtower if run_watchtower is set, even if lightning is not activated ( fix #5896 ).
...
Fix parameters of sweepstore.add_sweep_tx, rm dead code.
6 years ago
SomberNight
11452722af
network dns hacks: split from network.py into its own file
6 years ago
SomberNight
cb88a3b6e4
dns hacks on windows: resolve A and AAAA records in parallel
6 years ago
SomberNight
0b0139c676
network.get_transaction: move some response validation logic from Synchronizer
6 years ago
SomberNight
37747d7469
split network main_taskgroup: create daemon.taskgroup
...
network.main_taskgroup restarts every time the proxy settings are changed,
many long-running tasks (some introduced with lightning) are not prepared for and do not want this.
6 years ago
SomberNight
6709ec4117
dns hacks on windows: cache dns when using dnspython
...
related #4421
related #5337
6 years ago
SomberNight
308517d473
python 3.8: adapt to breaking changes re asyncio.CancelledError
...
(and TimeoutError)
closes #5798
6 years ago
SomberNight
68dad21fb4
network: make best_effort_reliable smarter and a bit more lenient
...
related: #5815
6 years ago
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP
6 years ago
ThomasV
90ce9f195b
Allow user to enable lightning in the GUI. Make it a per-wallet setting.
6 years ago
SomberNight
8c1adc2f50
fix dns issue on Windows
...
closes #5638
6 years ago
SomberNight
b2920db8b8
config: enforce that SimpleConfig is singleton
...
related: #5629
6 years ago
SomberNight
d1026b5afe
follow-up: SimpleConfig is supposed to be singleton
...
see cefa4762ba
and #5629
6 years ago
SomberNight
befa8ea771
transaction: kill "name", "csv_delay", "cltv_expiry" fields
6 years ago
ThomasV
e5502a58ba
uncomment breach_remedy in watchtower
6 years ago
SomberNight
9e57a59615
network: handle main_taskgroup dying better. passthrough CancelledError
...
Previously if a task running in the main_taskgroup raised,
main_taskgroup might have never finished as fx.run (another task running
in main_taskgroup) could not be cancelled (it was swallowing the CancelledError).
Need to be careful with catching all Exceptions or BaseExceptions,
as that might result in a coroutine not being cancellable.
Note that from python 3.8 onwards, CancelledError will inherit from BaseException
instead of Exception, so catching all Exceptions is somewhat less horrible
but this will only really matter if we raise the min py version to 3.8...
Really, all "except BaseException" lines are suspect and at least should be
considered for replacement with "except Exception".
-----
regarding fx.run not being cancellable before, and relevant lines, see:
6197cfbb3b/electrum/network.py (L1171)
0decdffce2/aiorpcx/curio.py (L242)
0decdffce2/aiorpcx/curio.py (L199)
0decdffce2/aiorpcx/curio.py (L208)
0decdffce2/aiorpcx/curio.py (L218)
0decdffce2/aiorpcx/curio.py (L221)
6197cfbb3b/electrum/daemon.py (L194)
6197cfbb3b/electrum/daemon.py (L203)
6197cfbb3b/electrum/exchange_rate.py (L507)
6197cfbb3b/electrum/exchange_rate.py (L79)
6 years ago
SomberNight
ba431495db
lnworker: fix silent TypeError in _calc_routing_hints_for_invoice
6 years ago
ThomasV
f7c05f2602
Synchronize watchtower asynchronously:
...
- remove remote_commitment_to_be_revoked
- pass old ctns to lnsweep.create_sweeptxs_for_watchtower
- store the ctn of sweeptxs in sweepStore database
- request the highest ctn from sweepstore using get_ctn
- send sweeptxs asynchronously in LNWallet.sync_with_watchtower
6 years ago
SomberNight
4ccfa39fdd
cli: fix add_peer cmd
6 years ago
ThomasV
180f6d34be
separate channel_db module
6 years ago
ThomasV
746dd725c6
follow-up previous
6 years ago
ThomasV
842fff832f
enable lightning through command line option
6 years ago
ThomasV
730be17aba
Use separate lightning nodes for gossip and channel operations.
6 years ago
Janus
dd7c4b3bab
sqlite in lnrouter
6 years ago
SomberNight
9206b6225b
tmp fix for circular imports
6 years ago
SomberNight
bc06ded4b9
persist nodes in channel_db on disk
6 years ago