mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 23:54:22 +01:00
bitcoin: implement is_scid_depth_announceable helper.
The math is a bit tricky, so encapsulate it. Includes the extra 'e' in 'announcable' as noted by @cdecker :) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -376,9 +376,9 @@ void peer_start_channeld(struct channel *channel,
|
||||
|
||||
if (channel->scid) {
|
||||
scid = *channel->scid;
|
||||
/* Subtle: depth=1 at funding height. */
|
||||
reached_announce_depth = get_block_height(ld->topology) + 1 >=
|
||||
short_channel_id_blocknum(&scid) + ANNOUNCE_MIN_DEPTH;
|
||||
reached_announce_depth
|
||||
= is_scid_depth_announceable(&scid,
|
||||
get_block_height(ld->topology));
|
||||
log_debug(channel->log, "Already have funding locked in%s",
|
||||
reached_announce_depth
|
||||
? " (and ready to announce)" : "");
|
||||
|
||||
Reference in New Issue
Block a user