MCPcopy Index your code
hub / github.com/btcsuite/btcd / calcHashInputScripts

Function calcHashInputScripts

txscript/hashcache.go:170–179  ·  view source on GitHub ↗

calcHashInputAmts computes the hash digest of all the previous input scripts referenced by the passed transaction. This hash pre computation is only used for validating taproot inputs.

(tx *wire.MsgTx, inputFetcher PrevOutputFetcher)

Source from the content-addressed store, hash-verified

168// referenced by the passed transaction. This hash pre computation is only used
169// for validating taproot inputs.
170func calcHashInputScripts(tx *wire.MsgTx, inputFetcher PrevOutputFetcher) chainhash.Hash {
171 var b bytes.Buffer
172 for _, txIn := range tx.TxIn {
173 prevOut := inputFetcher.FetchPrevOutput(txIn.PreviousOutPoint)
174
175 _ = wire.WriteVarBytes(&b, 0, prevOut.PkScript)
176 }
177
178 return chainhash.HashH(b.Bytes())
179}
180
181// SegwitSigHashMidstate is the sighash midstate used in the base segwit
182// sighash calculation as defined in BIP 143.

Callers 1

NewTxSigHashesFunction · 0.85

Calls 2

FetchPrevOutputMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…