SomberNight
2ec548dda3
ChannelDB: avoid duplicate (host,port) entries in ChannelDB._addresses
...
before:
node_id -> set of (host, port, ts)
after:
node_id -> NetAddress -> timestamp
Look at e.g. add_recent_peer; we only want to store
the last connection time, not all of them.
5 years ago
SomberNight
9a803cd1d6
ChannelDB: fix get_last_good_address
5 years ago
ThomasV
1161ce919f
Move get_channel_info and get_channel_policy code, so that routing
...
hints can be created without access to a ChannelDB instance.
5 years ago
bitromortac
96c9a483d0
lnrater: follow-up
...
Add comment on node score and return copies of channel db dicts.
5 years ago
bitromortac
cc9e19409f
lnrater: module for node rating
...
Introduces LNRater, which analyzes the Lightning Network graph for
potential nodes to connect to by taking into account channel capacities,
channel open times and fee policies. A score is constructed to assign a
scalar to each node, which is then used to perform a weighted random
sampling of the nodes.
5 years ago
bitromortac
4efcb53d24
network: load gossip db early
...
The gossip db is loaded early when the network is started to save
time when the gui is locked and a wallet not yet loaded. Side effects
of the LNWallet to start peering when a channel db is loaded is
circumvented.
5 years ago
bitromortac
1eae324ddb
channeldb: implement dictionary conversion
...
Implements a way to represent the graph (excluding one own's node) in
terms of a dict, which is json encodeable. Address tuples are converted
to NamedTuples to have automatic annotation in the address outputs.
5 years ago
ThomasV
b505763867
Qt: do not show node_id in channels_list
6 years ago
ThomasV
ac67f7ae30
discard channel updates too far in the future, or too close apart (see #6124 )
6 years ago
SomberNight
7153e753d1
lnworker._pay: allow specifying path as argument
...
not exposed to CLI/etc yet but will be used in tests soon
6 years ago
ThomasV
f4dc93cb7d
lnworker: blacklist channel if policy is unchanged but has a new timestamp.
6 years ago
ThomasV
2d0ef78a11
channel_db: add verbose option to add_channel_update
6 years ago
ThomasV
c454564ed6
sql_db: do not require network object
6 years ago
ThomasV
9224404108
Move callback manager out of Network class
6 years ago
SomberNight
71635216df
ln feature bits: validate transitive feature deps everywhere
6 years ago
SomberNight
4b78bf94d4
lnaddr: add feature bit support to invoices
...
see https://github.com/lightningnetwork/lightning-rfc/pull/656
6 years ago
SomberNight
6ba08cc8d4
ln feature bits: flatten namespaces, and impl feature deps and ctxs
...
This implements:
- flat feature bits https://github.com/lightningnetwork/lightning-rfc/pull/666
- feature bit dependencies https://github.com/lightningnetwork/lightning-rfc/pull/719
6 years ago
SomberNight
3a73f6ee5c
lnmsg.decode_msg: dict values for numbers are int, instead of BE bytes
...
Will be useful for TLVs where it makes sense to do the conversion in lnmsg,
as it might be more complicated than just int.from_bytes().
6 years ago
SomberNight
4c10a830f3
lnmsg: rewrite LN msg encoding/decoding
6 years ago
ThomasV
beac1c4ddc
channel_db: raise specific exception if database is not loaded when we try to find a route
6 years ago
SomberNight
99f736f3e7
ChannelDB.load_data: add comment re bad performance, and some speed-up
...
On my machine, ChannelDB.load_data() went from around 6 sec to 4 sec,
just by commenting out that assert in lnmsg.
related #6006
6 years ago
SomberNight
4d6b0184b9
ChannelDB: fix typo in sql query - seems harmless though?
6 years ago
SomberNight
3f9e761b67
ChannelDB: (trivial) add prefix to names of db methods
...
(and some type annotations)
This makes it clear these methods are not public.
6 years ago
SomberNight
53564f2496
ChannelDB: rm NodeAddress class, just use LNPeerAddr
6 years ago
SomberNight
a97e7bae05
ChannelDB: make gossip sync progress updates cheaper
...
get_num_channels_partitioned_by_policy_count() was too slow
6 years ago
SomberNight
9cdc3287c1
ChannelDB: trivial fixes re node alias
6 years ago
SomberNight
5ac01ff6ae
ChannelDB: fix get_recent_peers
6 years ago
SomberNight
67d24bf129
add LN gossip sync progress estimate indicator to Qt GUI
6 years ago
SomberNight
fd56fb9189
ChannelDB: add self.lock and make it thread-safe
6 years ago
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