multi: bump btcd to taproot aware version

This commit is contained in:
Oliver Gugger
2022-03-18 18:37:43 +01:00
parent 0dcaa511a2
commit 72c9582b85
24 changed files with 228 additions and 107 deletions

View File

@@ -1615,7 +1615,7 @@ func (l *LightningWallet) handleChanPointReady(req *continueContributionMsg) {
KeyDesc: ourKey,
Output: fundingOutput,
HashType: txscript.SigHashAll,
SigHashes: txscript.NewTxSigHashes(theirCommitTx),
SigHashes: input.NewTxSigHashesV0Only(theirCommitTx),
InputIndex: 0,
}
sigTheirCommit, err := l.Cfg.Signer.SignOutputRaw(theirCommitTx, &signDesc)
@@ -1690,7 +1690,7 @@ func (l *LightningWallet) verifyFundingInputs(fundingTx *wire.MsgTx,
remoteInputScripts []*input.Script) error {
sigIndex := 0
fundingHashCache := txscript.NewTxSigHashes(fundingTx)
fundingHashCache := input.NewTxSigHashesV0Only(fundingTx)
inputScripts := remoteInputScripts
for i, txin := range fundingTx.TxIn {
if len(inputScripts) != 0 && len(txin.Witness) == 0 {
@@ -1727,6 +1727,9 @@ func (l *LightningWallet) verifyFundingInputs(fundingTx *wire.MsgTx,
output.PkScript, fundingTx, i,
txscript.StandardVerifyFlags, nil,
fundingHashCache, output.Value,
txscript.NewCannedPrevOutputFetcher(
output.PkScript, output.Value,
),
)
if err != nil {
return fmt.Errorf("cannot create script "+
@@ -1806,7 +1809,7 @@ func (l *LightningWallet) handleFundingCounterPartySigs(msg *addCounterPartySigs
// Next, create the spending scriptSig, and then verify that the script
// is complete, allowing us to spend from the funding transaction.
channelValue := int64(res.partialState.Capacity)
hashCache := txscript.NewTxSigHashes(commitTx)
hashCache := input.NewTxSigHashesV0Only(commitTx)
sigHash, err := txscript.CalcWitnessSigHash(
witnessScript, hashCache, txscript.SigHashAll, commitTx,
0, channelValue,
@@ -1957,7 +1960,7 @@ func (l *LightningWallet) handleSingleFunderSigs(req *addSingleFunderSigsMsg) {
req.fundingOutpoint, spew.Sdump(theirCommitTx))
channelValue := int64(pendingReservation.partialState.Capacity)
hashCache := txscript.NewTxSigHashes(ourCommitTx)
hashCache := input.NewTxSigHashesV0Only(ourCommitTx)
theirKey := pendingReservation.theirContribution.MultiSigKey
ourKey := pendingReservation.ourContribution.MultiSigKey
witnessScript, _, err := input.GenFundingPkScript(
@@ -2008,7 +2011,7 @@ func (l *LightningWallet) handleSingleFunderSigs(req *addSingleFunderSigsMsg) {
Value: channelValue,
},
HashType: txscript.SigHashAll,
SigHashes: txscript.NewTxSigHashes(theirCommitTx),
SigHashes: input.NewTxSigHashesV0Only(theirCommitTx),
InputIndex: 0,
}
sigTheirCommit, err := l.Cfg.Signer.SignOutputRaw(theirCommitTx, &signDesc)