gossip: Adding locally added channels to channels map

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-02-01 16:10:01 +01:00
committed by Rusty Russell
parent 26b5588656
commit a88076b1b0
3 changed files with 55 additions and 7 deletions

View File

@@ -96,6 +96,9 @@ struct routing_channel {
struct node *nodes[2];
u64 msg_indexes[3];
/* Is this a public channel, or was it only added locally? */
bool public;
};
struct routing_state {
@@ -180,6 +183,15 @@ void routing_failure(struct routing_state *rstate,
enum onion_type failcode,
const u8 *channel_update);
/* routing_channel constructor */
struct routing_channel *routing_channel_new(const tal_t *ctx,
struct short_channel_id *scid);
/* Add the connection to the channel */
void channel_add_connection(struct routing_state *rstate,
struct routing_channel *chan,
struct node_connection *nc);
/* Utility function that, given a source and a destination, gives us
* the direction bit the matching channel should get */
#define get_channel_direction(from, to) (pubkey_cmp(from, to) > 0)