lnwallet: convert commitment no-delay output to p2wsh
This commit is contained in:
parent
05fb9b5a6d
commit
ac8736ff99
@ -717,13 +717,8 @@ func createCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Next, we create the script paying to them. This is just a regular
|
// Next, we create the script paying to them. This is just a regular
|
||||||
// P2PKH-like output, without any added CSV delay. However, we instead
|
// P2WKH output, without any added CSV delay.
|
||||||
// use P2SH.
|
theirWitnessKeyHash, err := commitScriptUnencumbered(theirKey)
|
||||||
theirRedeemScript, err := commitScriptUnencumbered(theirKey)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
payToThemScriptHash, err := witnessScriptHash(theirRedeemScript)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -735,7 +730,7 @@ func createCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey
|
|||||||
commitTx.Version = 2
|
commitTx.Version = 2
|
||||||
commitTx.AddTxIn(fundingOutput)
|
commitTx.AddTxIn(fundingOutput)
|
||||||
commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash))
|
commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash))
|
||||||
commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), payToThemScriptHash))
|
commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), theirWitnessKeyHash))
|
||||||
|
|
||||||
return commitTx, nil
|
return commitTx, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user