gossip: Use the custom gossip wire msg to wrap channel_announcements

This stores and reads the channel_announcements in the wrapping message which
allows us to store associated data with the raw channel_announcements.

The gossip_store applies channel_announcements directly but it also returns it,
and it gets discarded as a duplicate. In the next commit we'll have gossip_store
apply all changes, bypassing verification, so the duplication is only temporary.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-03-23 17:34:11 +01:00
committed by Rusty Russell
parent 6894f20927
commit 6e01f38d7d
7 changed files with 66 additions and 7 deletions

View File

@@ -833,7 +833,7 @@ bool handle_pending_cannouncement(struct routing_state *rstate,
}
if (pending->store)
gossip_store_append(rstate->store, pending->announce);
gossip_store_add_channel_announcement(rstate->store, pending->announce, satoshis);
routing_add_channel_announcement(rstate, pending->announce, satoshis);
local = pubkey_eq(&pending->node_id_1, &rstate->local_id) ||