mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
lnwallet: properly use the p2wkh script in SignDesc for retributions
This commit fixes a minor bug (that doesn’t affect anything atm) when crafting the SignDesc for sweeping breached outputs. Previously, we would take the p2wkh script and then p2wsh-ify that, placing that into the SignDesc. This is incorrect as the p2wkh script is “injected” into the sighash when signing, and thus doesn’t need another encoding layer.
This commit is contained in:
parent
1d487ea78b
commit
34604f6214
@ -1147,10 +1147,6 @@ func newBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
localWitnessHash, err := witnessScriptHash(localPkScript)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// In order to fully populate the breach retribution struct, we'll need
|
||||
// to find the exact index of the local+remote commitment outputs.
|
||||
@ -1194,7 +1190,7 @@ func newBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
||||
PubKey: chanState.LocalChanCfg.PaymentBasePoint,
|
||||
WitnessScript: localPkScript,
|
||||
Output: &wire.TxOut{
|
||||
PkScript: localWitnessHash,
|
||||
PkScript: localPkScript,
|
||||
Value: int64(localAmt),
|
||||
},
|
||||
HashType: txscript.SigHashAll,
|
||||
|
Loading…
Reference in New Issue
Block a user