gossip: Add a map for pending node_announcements

We were dropping these on the floor while checking for txout. So now
we add a map that holds announcements while we are checking.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-02-02 19:49:12 +01:00
committed by Rusty Russell
parent 35b44d5294
commit 0790d9b52f
2 changed files with 76 additions and 0 deletions

View File

@@ -84,6 +84,8 @@ size_t node_map_hash_key(const secp256k1_pubkey *key);
bool node_map_node_eq(const struct node *n, const secp256k1_pubkey *key);
HTABLE_DEFINE_TYPE(struct node, node_map_keyof_node, node_map_hash_key, node_map_node_eq, node_map);
struct pending_node_map;
enum txout_state {
TXOUT_FETCHING,
TXOUT_PRESENT,
@@ -108,6 +110,8 @@ struct routing_state {
/* All known nodes. */
struct node_map *nodes;
struct pending_node_map *pending_node_map;
/* channel_announcement which are pending short_channel_id lookup */
struct list_head pending_cannouncement;