watchtower/lookout: make justice desciptor taproot ready

This commit is contained in:
Elle Mouton committed 2024-01-18 18:06:00 +02:00
1 parent 5960253357
commit c50aa10194
3 files changed
+264 -51

No files matched your search

+3 -1
View File
@@ -176,6 +176,8 @@ func (p *JusticeDescriptor) assembleJusticeTxn(txWeight int64,
return nil, fmt.Errorf("error creating previous output "+
"fetcher: %v", err)
}
hashes := txscript.NewTxSigHashes(justiceTxn, prevOutFetcher)
for _, inp := range inputs {
// Lookup the input's new post-sort position.
i := inputIndex[inp.outPoint]
@@ -186,7 +188,7 @@ func (p *JusticeDescriptor) assembleJusticeTxn(txWeight int64,
vm, err := txscript.NewEngine(
inp.txOut.PkScript, justiceTxn, i,
txscript.StandardVerifyFlags,
nil, nil, inp.txOut.Value, prevOutFetcher,
nil, hashes, inp.txOut.Value, prevOutFetcher,
)
if err != nil {
return nil, err