1
0

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.
This commit is contained in:
bitromortac
2020-10-28 08:17:25 +01:00
parent 59f7d4b02d
commit cc9e19409f
4 changed files with 288 additions and 15 deletions

View File

@@ -760,6 +760,14 @@ class ChannelDB(SqlDB):
def get_node_info_for_node_id(self, node_id: bytes) -> Optional['NodeInfo']:
return self._nodes.get(node_id)
def get_node_infos(self) -> Dict[bytes, NodeInfo]:
with self.lock:
return self._nodes
def get_node_policies(self) -> Dict[Tuple[bytes, ShortChannelID], Policy]:
with self.lock:
return self._policies
def to_dict(self) -> dict:
""" Generates a graph representation in terms of a dictionary.