mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 20:54:23 +01:00
gossipd: don't close non-local channels immediately, add 12 block delay.
This adds a new "chan_dying" message to the gossip_store, but since we already changed the minor version in this PR, we don't bump it again. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: Protocol: We now delay forgetting funding-spent channels for 12 blocks (as per latest BOLTs, to support splicing in future).
This commit is contained in:
@@ -68,6 +68,7 @@ int main(int argc, char *argv[])
|
||||
u32 msglen = be32_to_cpu(hdr.len);
|
||||
u8 *msg, *inner;
|
||||
bool deleted, push, ratelimit;
|
||||
u32 blockheight;
|
||||
|
||||
deleted = (msglen & GOSSIP_STORE_LEN_DELETED_BIT);
|
||||
push = (msglen & GOSSIP_STORE_LEN_PUSH_BIT);
|
||||
@@ -121,6 +122,11 @@ int main(int argc, char *argv[])
|
||||
printf("delete channel: %s\n",
|
||||
type_to_string(tmpctx, struct short_channel_id,
|
||||
&scid));
|
||||
} else if (fromwire_gossip_store_chan_dying(msg, &scid, &blockheight)) {
|
||||
printf("dying channel: %s (deadline %u)\n",
|
||||
type_to_string(tmpctx, struct short_channel_id,
|
||||
&scid),
|
||||
blockheight);
|
||||
} else {
|
||||
warnx("Unknown message %u",
|
||||
fromwire_peektype(msg));
|
||||
|
||||
Reference in New Issue
Block a user