channel: skip unsaved channels

Now that "peer->channels" contains `unsaved` channels, skip overthem
where appropriate
This commit is contained in:
niftynei
2021-01-21 18:55:23 -06:00
committed by neil saitug
parent b9f867b1dd
commit da81d4bced
13 changed files with 86 additions and 11 deletions

View File

@@ -714,10 +714,13 @@ void channel_notify_new_block(struct lightningd *ld,
size_t i;
list_for_each (&ld->peers, peer, list) {
list_for_each (&peer->channels, channel, list)
list_for_each (&peer->channels, channel, list) {
if (channel_unsaved(channel))
continue;
if (is_fundee_should_forget(ld, channel, block_height)) {
tal_arr_expand(&to_forget, channel);
}
}
}
/* Need to forget in a separate loop, else the above