You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signatures sign H(prefixHash || witnessHash), but prefixHash never changes for sigHashAll. The Copy() call in calcSignatureHash can then be easily avoided if the transaction hash is simply reused and the transaction witness, or the hash of the referenced pkScript in this case, calculated on the fly.
The text was updated successfully, but these errors were encountered:
Legacy transaction deep copy code mandated by the Bitcoin protocol
caused large amounts of data to be copied needlessly. If the
optimization for SigHashAll is set in chaincfg/params.go, these
extra copies are avoided by directly writing the pkScript and
decorations to a buffer and then hashing to get a witness hash,
while using the cached hash for the prefix.
Fixes#126.
Signatures sign H(prefixHash || witnessHash), but prefixHash never changes for sigHashAll. The Copy() call in calcSignatureHash can then be easily avoided if the transaction hash is simply reused and the transaction witness, or the hash of the referenced pkScript in this case, calculated on the fly.
The text was updated successfully, but these errors were encountered: