From c24189210417df7c729ef845b33a28493483cfef Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 24 Mar 2017 16:13:29 -0700 Subject: [PATCH] lnwallet: use full struct initialization for outputs in CreateCommitmentTx --- lnwallet/channel.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index b294037f..7663e220 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -2561,10 +2561,16 @@ func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey // Avoid creating dust outputs within the commitment transaction. if amountToSelf >= dustLimit { - commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash)) + commitTx.AddTxOut(&wire.TxOut{ + PkScript: payToUsScriptHash, + Value: int64(amountToSelf), + }) } if amountToThem >= dustLimit { - commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), theirWitnessKeyHash)) + commitTx.AddTxOut(&wire.TxOut{ + PkScript: theirWitnessKeyHash, + Value: int64(amountToThem), + }) } return commitTx, nil