From 2141b481efa882794c050544466898e40b4dd1c4 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 29 Sep 2017 14:28:10 -0700 Subject: [PATCH] lnwallet: properly set the pkScript within an HTLC resolution --- lnwallet/channel.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 93ffeca6..dad73d07 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3475,6 +3475,10 @@ func newHtlcResolution(signer Signer, localChanCfg *channeldb.ChannelConfig, if err != nil { return nil, err } + htlcScriptHash, err := witnessScriptHash(htlcSweepScript) + if err != nil { + return nil, err + } return &OutgoingHtlcResolution{ Expiry: htlc.RefundTimeout, @@ -3484,7 +3488,8 @@ func newHtlcResolution(signer Signer, localChanCfg *channeldb.ChannelConfig, SingleTweak: commitTweak, WitnessScript: htlcSweepScript, Output: &wire.TxOut{ - Value: int64(secondLevelOutputAmt), + PkScript: htlcScriptHash, + Value: int64(secondLevelOutputAmt), }, HashType: txscript.SigHashAll, },