From 21782374c949fb465401c4f46e8f300498aeca92 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 26 Sep 2017 18:31:15 -0700 Subject: [PATCH] lnwallet: properly use delayKey for htlc-timeout tx in newHtlcResolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes an existing bug when crafting the HTLC resolution in the face of a commitment broadcast. Previously, we we’re using the localKey which is incorrect, as directly below we properly use the delayKey when crafting the secondLevelHtlcScript to sign. --- lnwallet/channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 55b183f2..1b101984 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3431,7 +3431,7 @@ func newHtlcResolution(signer Signer, localChanCfg *channeldb.ChannelConfig, // transaction. timeoutTx, err := createHtlcTimeoutTx(op, secondLevelOutputAmt, htlc.RefundTimeout, uint32(localChanCfg.CsvDelay), - revokeKey, localKey, + revokeKey, delayKey, ) if err != nil { return nil, err