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)
2019-08-30 19:46:25 +02:00
SomberNight
ba431495db
lnworker: fix silent TypeError in _calc_routing_hints_for_invoice
2019-08-20 09:03:12 +02:00
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
2019-08-20 09:03:12 +02:00
SomberNight
4ccfa39fdd
cli: fix add_peer cmd
2019-08-20 09:03:12 +02:00
ThomasV
180f6d34be
separate channel_db module
2019-08-20 09:03:12 +02:00
ThomasV
746dd725c6
follow-up previous
2019-08-20 09:03:11 +02:00
ThomasV
842fff832f
enable lightning through command line option
2019-08-20 09:03:11 +02:00
ThomasV
730be17aba
Use separate lightning nodes for gossip and channel operations.
2019-08-20 09:03:11 +02:00
Janus
dd7c4b3bab
sqlite in lnrouter
2019-08-20 09:03:11 +02:00
SomberNight
9206b6225b
tmp fix for circular imports
2019-08-20 09:03:11 +02:00
SomberNight
bc06ded4b9
persist nodes in channel_db on disk
2019-08-20 09:03:10 +02:00
SomberNight
a5b44d25b0
persist channel db on disk. verify channel gossip sigs.
2019-08-20 09:03:10 +02:00
SomberNight
c1d1826014
start using electrum protocol 1.4
2019-08-20 09:03:10 +02:00
ThomasV
c7e47b74a9
Separate open_channel dialog. In open_channel_coroutine, use host and port from channel announcements
2019-08-20 09:03:10 +02:00
ThomasV
61983c222a
lightning: single shared instance of Watcher, ChannelDB and PathFinder
2019-08-20 09:03:10 +02:00
Janus
98f6f67c6b
lightning: misc patches, launch asyncio loop on separate thread
2019-08-20 09:03:09 +02:00
SomberNight
a10dc04b28
wallet: fix offline hw wallet signing when not specifying --offline
...
closes #5532
2019-07-29 13:27:37 +02:00
SomberNight
a2bffb9137
network: harden against eclipse attacks
2019-06-27 19:10:25 +02:00
SomberNight
104b8804f7
logging: '-V' cli option can blacklist/whitelist classes with short names
...
for example, '-V ni' will whitelist the 'Network' and 'Interface' classes
'-V ^ni' will blacklist those instead
2019-05-07 21:07:18 +02:00
SomberNight
2481d708cc
network: sanitize_tx_broadcast_response - new strings in bitcoind 0.18
2019-05-05 04:34:31 +02:00
SomberNight
0c963b0894
network.broadcast_transaction: add "do not trust" text to log messages
2019-05-03 20:11:48 +02:00
SomberNight
6940c424d1
logging: cli options to filter for modules using -v
...
old style "-v" still works
filtering examples:
-v=debug,network=error,interface=error // effectively blacklists network and interface
-v=warning,network=debug,interface=debug // effectively whitelists network and interface
2019-05-02 15:19:10 +02:00
SomberNight
3385a94753
logging: basics
2019-05-02 15:19:03 +02:00
SomberNight
1110f13c62
network: allow longer timeouts in _run_new_interface
...
On Windows box with weird networking setup (VPN, no IPv6, many DNS nameservers
but only some working well), the previous timeouts were too low: they were
reached due to DNS resolution.
related: #4421
2019-04-18 23:05:35 +02:00
SomberNight
c49d5f672c
network: fix proxy case
...
follow-up "healty spread of servers" d8f3ab0917
2019-04-15 10:49:09 +02:00
SomberNight
d8f3ab0917
network: do not connect to multiple servers on same /16
...
maintain a healthy spread of (IP addresses of) connected servers
2019-04-12 22:32:36 +02:00
SomberNight
7ddc28b0dc
network: cap number of server peers accepted from main server
2019-04-12 22:24:36 +02:00
SomberNight
d07fce0826
windows DNS resolution: handle domain with only AAAA records
...
this is getting too complicated :/
2019-03-26 16:52:11 +01:00
SomberNight
c4fb58cd74
windows DNS resolution: follow-up 9b0773cf2b
...
related: #5176 , #4421
prev was failing on systems where
IPv6 is not available but DNS can resolve AAAA records
(my artificial test environment with IPv6 disabled was also filtering AAAA DNS)
2019-03-26 03:07:11 +01:00
SomberNight
1cfac928f9
trustedcoin: longer timeout for server signing
...
fixes #5221
2019-03-25 23:36:52 +01:00
SomberNight
9b0773cf2b
windows DNS resolution: handle IPv6
...
related: #5176 , #4421
2019-03-25 19:15:19 +01:00
SomberNight
6702c335e8
network: (trivial) ignore empty string donation address
2019-03-22 17:30:12 +01:00
ThomasV
791e680a96
abstract database away from wallet and address_synchronizer
2019-02-28 09:02:58 +01:00
SomberNight
4b3a285871
exchange_rate: some clean-up and fixes
...
- generation of currencies.json was broken
- removed some dead exchanges
2019-02-27 21:48:33 +01:00
ThomasV
52520490c5
improve network send_multiple_requests
2019-02-15 17:37:15 +01:00
SomberNight
7b8114f865
synchronizer: allow server not finding txn sometimes
...
User has wallet file with history that includes some txid; corresponding
raw tx is not in the "transactions" dict in the file however.
When the synchronizer starts up, it requests this "missing" txn from
the server... but what if the server does not know about it?
Maybe it was reorged and is not in the new best chain,
and not even in mempool. This was not handled previously.
fix #5122
2019-02-14 20:54:55 +01:00
ghost43
c8562f5362
network: reintroduce network.debug ( #5093 )
...
network.debug and interface.debug were removed during the asyncio-aiorpcx
network-rewrite.
2019-02-12 20:23:43 +01:00
SomberNight
019884a98b
network: follow-up 38ab7ee554
2019-02-12 19:23:58 +01:00
SomberNight
38ab7ee554
network: catch untrusted exceptions from server in public methods
...
and re-raise a wrapper exception (that retains the original exc in a field)
closes #5111
2019-02-12 17:02:15 +01:00
SomberNight
8072ad1ad9
network broadcast_transaction: make error text clearer
2019-02-11 16:36:01 +01:00
ThomasV
6ade5903dc
network: fix send_multiple_requests
2019-02-07 13:30:14 +01:00
ThomasV
4ed8787433
remove 'util.py' from scripts
2019-02-05 20:33:50 +01:00
SomberNight
bc2a421d87
network: clean up broadcast_transaction
...
Handle all exceptions in network.py, instead of in gui code.
Send some exceptions to crash reporter; previously gui code
would suppress them.
2019-02-04 20:27:00 +01:00
SomberNight
52d602b6c1
network: fix get_servers to not modify default list
2019-02-02 20:10:12 +01:00
SomberNight
e39e2ed8f1
fix typo
...
follow-up #5011
closes #5014
2019-01-19 17:50:22 +01:00
SomberNight
5403ae7687
network: sanitize tx broadcast response
2019-01-18 20:25:21 +01:00
SomberNight
5248613e9d
gui: prepend broadcast_transaction errors with explanatory message
2018-12-21 20:44:38 +01:00
ghost43
7773443c17
network: put NetworkTimeout constants together ( #4945 )
...
* network: put NetworkTimeout constants together
* fix prev
2018-12-20 16:49:17 +01:00
SomberNight
9607854b67
network: fix switching interface (restart old one)
...
follow-up b3ff173b45
connection_down was killing the already restarted old interface
2018-12-10 08:03:42 +01:00
SomberNight
62e352a2a8
network: don't let _maintain_sessions die from CancelledError
...
as then the network would get paralysed and no one can fix it
2018-12-09 20:04:42 +01:00