SomberNight
a32af44ff9
trivial clean-up (typing/imports)
6 years ago
ThomasV
55a0043ab7
follow-up previous commit (fix tests)
6 years ago
ThomasV
97900c0985
store raw messages in gossip_db. Fixes #5960
6 years ago
ThomasV
9d0a862a43
revert prrevious commit (used in tests)
6 years ago
ThomasV
9680e7836c
remove ChannelDB.add_channel_update (no longer needed after 46d8080c76)
6 years ago
SomberNight
46d8080c76
ln gossip: don't put own channels into db; always pass them to fn calls
...
Previously we would put fake chan announcement and fake outgoing chan upd
for own channels into db (to make path finding work). See Peer.add_own_channel().
Now, instead of above, we pass a "my_channels" param to the relevant ChannelDB methods.
6 years ago
SomberNight
24ebc77d76
ln chan verifier: fix code rot
6 years ago
SomberNight
13d6997355
LNPeerAddr: validate arguments
...
no longer subclassing NamedTuple (as it is difficult to do validation then...)
6 years ago
ThomasV
a4944cdcb2
delete channel from db in remove_channel, becaose it is called from lnworker
6 years ago
SomberNight
106bc6d2b2
follow-up prev
6 years ago
ThomasV
0966edc637
fine-grained callbacks for lightning network dialog
6 years ago
ThomasV
3897cf725d
move handle_error_code_from_failed_htlc to lnworker because it requires access to the network object
6 years ago
ThomasV
5377eb907c
follow-up dd0be1541e
6 years ago
ThomasV
dd0be1541e
Improve handling of lightning payment status:
...
- Move 'handle_error_code_from_failed_htlc' to channel_db,
and call it from pay_to_route, because it should not be
called when HTLCs are forwarded.
- Replace 'payment_received' and 'payment_status'
callbacks with 'invoice_status' and 'request_status'.
- Show payment error logs in the Qt GUI
- In the invoices list, show paid invoices for which
we still have the log.
6 years ago
SomberNight
509df9ddaf
create class for ShortChannelID and use it
6 years ago
SomberNight
edf186da0d
channeldb.load_data: attempt at fixing race
...
closes #5525
6 years ago
ThomasV
bd57880799
do not raise exception when add_own_channel adds channel update from the cache
6 years ago
ThomasV
e286ed1c13
add_own_channel does not need to be async
6 years ago
SomberNight
fa5302bcfb
(trivial) fix type annotation
6 years ago
SomberNight
e54f0fbafa
do not raise BaseException
6 years ago
SomberNight
d955285808
lnrouter/channeldb: small import clean-up
6 years ago
SomberNight
f0588846d5
channeldb: also store "message_flags" field for channel updates
...
this is a breaking change for the db format.
As in comment in diff,
"It would make more sense to store the raw gossip messages in the db."
6 years ago
SomberNight
d229bb4e4d
lnpeer: restore "temp save orphan channel updates" functionality
...
needed to handle race where remote might send chan_upd too soon
(before we save the short channel id for the channel after it reaches funding locked)
6 years ago
SomberNight
ba431495db
lnworker: fix silent TypeError in _calc_routing_hints_for_invoice
6 years ago
ThomasV
39bae1c7cf
channel_db: load_data should load node_info
6 years ago
ThomasV
b55f9e9e6a
Do not route through channels for which we did not receive
...
both updates, because this often means one of the nodes is
offline.
6 years ago
ThomasV
30e942bead
fix: delete from channel_db
6 years ago
ThomasV
32fcad5bc3
channel_db: update channels_for_node when removing channel
6 years ago
ThomasV
238f3c949c
get rid of sql_alchemy
6 years ago
ThomasV
0eab1692d6
Do not store message payloads in channel db.
...
Use single primary key for addresses.
6 years ago
ThomasV
f2d58d0e3f
optimize channel_db:
...
- use python objects mirrored by sql database
- write sql to file asynchronously
- the sql decorator is awaited in sweepstore, not in channel_db
6 years ago
ThomasV
180f6d34be
separate channel_db module
6 years ago
ThomasV
115113f492
remove expensive sql request, python set comparison is faster
6 years ago
SomberNight
9a0ba7fa79
ChannelDB: trivial bugfix for get_channels_for_node
6 years ago
SomberNight
62f58c18fe
ChannelDB.on_node_announcement: some speed-up
...
(e.g. for 100 node anns, was ~5 seconds, now 0.7 sec; so still slow)
6 years ago
SomberNight
cffb89002c
fix ChannelDB.compare_channels: was raising "too many SQL variables"
...
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) too many SQL variables
6 years ago
ThomasV
0acd0c23d3
fix: key must be unique (sql)
6 years ago
ThomasV
eb4e6bb0de
improve filter_channel_updates
...
blacklist channels that do not really get updated
6 years ago
ThomasV
b055eeace2
prune channels older than two weeks from database
6 years ago
ThomasV
522ce5bb9f
verify channel updates in peer's TaskGroup
6 years ago
ThomasV
308dc6aa6b
use a single queue for gossip messages, so that they are processed in the correct order
6 years ago
ThomasV
e68f318b12
verify node and channel announcements before entering sql lock
6 years ago
ThomasV
0e42fd9f17
parallelize short_channel_id requests
6 years ago
ThomasV
1011245c5e
LNGossip: sync channel db using query_channel_range
6 years ago
ThomasV
31684abb51
do not SPV channel announcements; this is too resource intensive
6 years ago
SomberNight
cc57da704b
logging: adapt lightning branch to logging changes
6 years ago
ThomasV
34f22e6681
lnrouter: load data before finding path
6 years ago
ThomasV
b76728d459
lnrouter: fix get_last_good_address: one_or_none -> all
6 years ago
ThomasV
93e8d4f953
channel_db: fix timestamp_range, reduce verbosity
6 years ago
ThomasV
aa398993cf
lnrouter fixes:
...
- use gossip_queries_req instead of initial_routing_sync
- add connected nodes to recent peers only after successful init
- derive timestamp used with gossip_timestamp_filter from channel_db
- fix query_short_channel_ids:
1. channel IDs must be sorted with zlib
2. limit request to 100
3. do not abuse this to request node_announcements; it is fine not to have all nodes.
- fix get_recent_peers:
1. do not set last_connected_date to 'now' if we never connected a node
2. sql query was misconstructed and was returning only one peer
- populate FALLBACK_NODE_LIST_MAINNET with nodes that have the requested flags
6 years ago