MCPcopy Create free account
hub / github.com/ElementsProject/elements / LegacySignatureHash

Function LegacySignatureHash

test/functional/test_framework/script.py:796–808  ·  view source on GitHub ↗

Consensus-correct SignatureHash Returns (hash, err) to precisely match the consensus-critical behavior of the SIGHASH_SINGLE bug. (inIdx is *not* checked for validity)

(*args, **kwargs)

Source from the content-addressed store, hash-verified

794 return (s, None)
795
796def LegacySignatureHash(*args, **kwargs):
797 """Consensus-correct SignatureHash
798
799 Returns (hash, err) to precisely match the consensus-critical behavior of
800 the SIGHASH_SINGLE bug. (inIdx is *not* checked for validity)
801 """
802
803 HASH_ONE = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
804 msg, err = LegacySignatureMsg(*args, **kwargs)
805 if msg is None:
806 return (HASH_ONE, err)
807 else:
808 return (hash256(msg), err)
809
810# TODO: Allow cached hashPrevouts/hashSequence/hashOutputs to be provided.
811# Performance optimization probably not necessary for python tests, however.

Callers 5

run_testMethod · 0.90
sign_txMethod · 0.90
sign_txMethod · 0.90

Calls 2

LegacySignatureMsgFunction · 0.85
hash256Function · 0.70

Tested by 1