lnwallet/chanvalidate: update ValidateChannel to recognize taproot chans

This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:31:36 -07:00
1 parent b38f9000d5
commit c9fc508083
2 files changed
+39 -21

No files matched your search

+7 -3
View File
@@ -186,10 +186,14 @@ func Validate(ctx *Context) (*wire.OutPoint, error) {
// If we reach this point, then all other checks have succeeded, so
// we'll now attempt a full Script VM execution to ensure that we're
// able to close the channel using this initial state.
prevFetcher := txscript.NewCannedPrevOutputFetcher(
ctx.MultiSigPkScript, fundingValue,
)
commitTx := ctx.CommitCtx.FullySignedCommitTx
hashCache := txscript.NewTxSigHashes(commitTx, prevFetcher)
vm, err := txscript.NewEngine(
ctx.MultiSigPkScript, ctx.CommitCtx.FullySignedCommitTx,
0, txscript.StandardVerifyFlags, nil, nil, fundingValue,
txscript.NewCannedPrevOutputFetcher(ctx.MultiSigPkScript, 0),
ctx.MultiSigPkScript, commitTx, 0, txscript.StandardVerifyFlags,
nil, hashCache, fundingValue, prevFetcher,
)
if err != nil {
return nil, err