From cd8672f82496856c5aa3062a5d7cdf315ed72cde Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 30 Jul 2017 12:54:04 -0700 Subject: [PATCH] lnwallet: update CreateCommitTx due to new key derivation --- lnwallet/channel.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index f9d703b1c..802c7117d 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3054,9 +3054,9 @@ func (lc *LightningChannel) ReceiveUpdateFee(feePerKw btcutil.Amount) error { // CreateCommitTx creates a commitment transaction, spending from specified // funding output. The commitment transaction contains two outputs: one paying // to the "owner" of the commitment transaction which can be spent after a -// relative block delay or revocation event, and the other paying the the +// relative block delay or revocation event, and the other paying the // counterparty within the channel, which can be spent immediately. -func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey, +func CreateCommitTx(fundingOutput *wire.TxIn, delayKey, paymentKey *btcec.PublicKey, revokeKey *btcec.PublicKey, csvTimeout uint32, amountToSelf, amountToThem, dustLimit btcutil.Amount) (*wire.MsgTx, error) { @@ -3065,7 +3065,7 @@ func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey // output after a relative block delay, or the remote node can claim // the funds with the revocation key if we broadcast a revoked // commitment transaction. - ourRedeemScript, err := commitScriptToSelf(csvTimeout, selfKey, + ourRedeemScript, err := commitScriptToSelf(csvTimeout, delayKey, revokeKey) if err != nil { return nil, err @@ -3077,7 +3077,7 @@ func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey // Next, we create the script paying to them. This is just a regular // P2WPKH output, without any added CSV delay. - theirWitnessKeyHash, err := commitScriptUnencumbered(theirKey) + theirWitnessKeyHash, err := commitScriptUnencumbered(paymentKey) if err != nil { return nil, err }