From 8a682d9ec3c16f710ed6e92ab550114eb2f4b09c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 26 Sep 2017 18:00:16 -0700 Subject: [PATCH] lnwallet: add a MaturityDelay field to UnilateralCloseSummary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a new field: MaturityDelay, to the UnilateralCloseSummary struct. This new field will be required, in an upcoming update as it’s needed in order to properly sweep the second-level HTLC outputs after MaturityDelay blocks has passed since confirmation. --- lnwallet/channel.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 3968834a..55b183f2 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -1466,6 +1466,7 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven ChannelCloseSummary: closeSummary, SelfOutPoint: selfPoint, SelfOutputSignDesc: selfSignDesc, + MaturityDelay: uint32(lc.remoteChanCfg.CsvDelay), HtlcResolutions: htlcResolutions, } @@ -3374,6 +3375,11 @@ type UnilateralCloseSummary struct { // generating a valid signature to sweep the output paying to us SelfOutputSignDesc *SignDescriptor + // MaturityDelay is the relative time-lock, in blocks for all outputs + // that pay to the local party within the broadcast commitment + // transaction. + MaturityDelay uint32 + // HtlcResolutions is a slice of HTLC resolutions which allows the // local node to sweep any outgoing HTLC"s after the timeout period has // passed.