Skip to content

Commit 0c09892

Browse files
author
Bob McElrath
committed
Encode hashtype as signed (following bitcoind)
1 parent eca69b7 commit 0c09892

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bitcoin/core/script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def RawSignatureHash(script, txTo, inIdx, hashtype):
958958

959959
txtmp.wit = bitcoin.core.CTxWitness()
960960
s = txtmp.serialize()
961-
s += struct.pack(b"<I", hashtype)
961+
s += struct.pack(b"<i", hashtype)
962962

963963
hash = bitcoin.core.Hash(s)
964964

@@ -1011,7 +1011,7 @@ def SignatureHash(script, txTo, inIdx, hashtype, amount=None, sigversion=SIGVERS
10111011
f.write(struct.pack("<I", txTo.vin[inIdx].nSequence))
10121012
f.write(hashOutputs)
10131013
f.write(struct.pack("<i", txTo.nLockTime))
1014-
f.write(struct.pack("<I", hashtype))
1014+
f.write(struct.pack("<i", hashtype))
10151015

10161016
return bitcoin.core.Hash(f.getvalue())
10171017

0 commit comments

Comments
 (0)