ZIP 244: Change semantics of sequence_sig_digest

This commit is contained in:
Jack Grigg 2022-01-05 16:52:46 +00:00
parent 61894e7793
commit 29872dcaa0
1 changed files with 2 additions and 7 deletions

View File

@ -261,13 +261,8 @@ def prevouts_sig_digest(tx, nHashType):
return blake2b(digest_size=32, person=b'ZTxIdPrevoutHash').digest()
def sequence_sig_digest(tx, nHashType):
# if the SIGHASH_ANYONECANPAY flag is not set, and the sighash type is neither
# SIGHASH_SINGLE nor SIGHASH_NONE:
if (
(not (nHashType & SIGHASH_ANYONECANPAY)) and \
(nHashType & 0x1f) != SIGHASH_SINGLE and \
(nHashType & 0x1f) != SIGHASH_NONE
):
# if the SIGHASH_ANYONECANPAY flag is not set:
if not (nHashType & SIGHASH_ANYONECANPAY):
return getHashSequence(tx, b'ZTxIdSequencHash')
else:
return blake2b(digest_size=32, person=b'ZTxIdSequencHash').digest()