From 08200423a78401585956f1886f67ad9715c479f2 Mon Sep 17 00:00:00 2001 From: niftynei Date: Fri, 23 Jul 2021 12:13:31 -0500 Subject: [PATCH] channel lease: only send update_blockheight iff has channel lease otherwise the peer may not know to expect it. --- channeld/channeld.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 438de3c20..4d0ae97a1 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -2451,9 +2451,11 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last) channel_feerate(peer->channel, REMOTE)); sync_crypto_write(peer->pps, take(msg)); - msg = towire_update_blockheight(NULL, &peer->channel_id, - channel_blockheight(peer->channel, REMOTE)); - sync_crypto_write(peer->pps, take(msg)); + if (peer->channel->lease_expiry > 0) { + msg = towire_update_blockheight(NULL, &peer->channel_id, + channel_blockheight(peer->channel, REMOTE)); + sync_crypto_write(peer->pps, take(msg)); + } } /* Re-send the commitment_signed itself. */