mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 08:55:59 +01:00
lnwallet: convert commitment no-delay output to p2wsh
This commit is contained in:
parent
05fb9b5a6d
commit
ac8736ff99
1 changed files with 3 additions and 8 deletions
|
@ -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
|
||||
// P2PKH-like output, without any added CSV delay. However, we instead
|
||||
// use P2SH.
|
||||
theirRedeemScript, err := commitScriptUnencumbered(theirKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
payToThemScriptHash, err := witnessScriptHash(theirRedeemScript)
|
||||
// P2WKH output, without any added CSV delay.
|
||||
theirWitnessKeyHash, err := commitScriptUnencumbered(theirKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -735,7 +730,7 @@ func createCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey
|
|||
commitTx.Version = 2
|
||||
commitTx.AddTxIn(fundingOutput)
|
||||
commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash))
|
||||
commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), payToThemScriptHash))
|
||||
commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), theirWitnessKeyHash))
|
||||
|
||||
return commitTx, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue