mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
irc: Add contact information to nodes
The routing table now includes hostnames and ports for the node as well as a helper to add/update the nodes we learn about.
This commit is contained in:
@@ -20,6 +20,11 @@ struct node_connection {
|
||||
|
||||
struct node {
|
||||
struct pubkey id;
|
||||
|
||||
/* IP/Hostname and port of this node */
|
||||
char *hostname;
|
||||
int port;
|
||||
|
||||
/* Routes connecting to us, from us. */
|
||||
struct node_connection **in, **out;
|
||||
|
||||
@@ -46,6 +51,12 @@ struct node *get_node(struct lightningd_state *dstate,
|
||||
* If it returns more than msatoshi, it overflowed. */
|
||||
s64 connection_fee(const struct node_connection *c, u64 msatoshi);
|
||||
|
||||
/* Updates existing node, or creates a new one as required. */
|
||||
struct node *add_node(struct lightningd_state *dstate,
|
||||
const struct pubkey *pk,
|
||||
char *hostname,
|
||||
int port);
|
||||
|
||||
/* Updates existing connection, or creates new one as required. */
|
||||
struct node_connection *add_connection(struct lightningd_state *dstate,
|
||||
const struct pubkey *from,
|
||||
|
||||
Reference in New Issue
Block a user