mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 21:24:22 +01:00
gossip_store: make private channels more similar to channel_announcement
Instead of a boutique message, use a "real" channel_announcement for private channels (with fake sigs and pubkeys). This makes it far easier for gossmap to handle local channels. Backwards compatible update, since we update old stores. We also fix devtools/dump-gossipstore to know about the tombstone markers. Since we increment our channel_announce count for local channels now, the stats in the tests changed too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -53,6 +53,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (read(fd, &hdr, sizeof(hdr)) == sizeof(hdr)) {
|
||||
struct amount_sat sat;
|
||||
struct short_channel_id scid;
|
||||
u32 msglen = be32_to_cpu(hdr.len);
|
||||
u8 *msg, *inner;
|
||||
bool deleted, push;
|
||||
@@ -92,13 +93,19 @@ int main(int argc, char *argv[])
|
||||
printf("t=%u node_announcement: %s\n",
|
||||
be32_to_cpu(hdr.timestamp),
|
||||
tal_hex(msg, msg));
|
||||
} else if (fromwire_peektype(msg) == WIRE_GOSSIPD_LOCAL_ADD_CHANNEL) {
|
||||
printf("local_add_channel: %s\n",
|
||||
tal_hex(msg, msg));
|
||||
} else if (fromwire_gossip_store_private_channel(msg, msg, &sat,
|
||||
&inner)) {
|
||||
printf("private channel_announcement: %s %s\n",
|
||||
type_to_string(tmpctx, struct amount_sat, &sat),
|
||||
tal_hex(msg, inner));
|
||||
} else if (fromwire_gossip_store_private_update(msg, msg,
|
||||
&inner)) {
|
||||
printf("private channel_update: %s\n",
|
||||
tal_hex(msg, inner));
|
||||
} else if (fromwire_gossip_store_delete_chan(msg, &scid)) {
|
||||
printf("delete channel: %s\n",
|
||||
type_to_string(tmpctx, struct short_channel_id,
|
||||
&scid));
|
||||
} else {
|
||||
warnx("Unknown message %u",
|
||||
fromwire_peektype(msg));
|
||||
|
||||
Reference in New Issue
Block a user