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)
| 794 | return (s, None) |
| 795 | |
| 796 | def 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. |