Skip to content

Commit 88b1229

Browse files
committed
Merge bitcoin#29400: test: Fix SegwitV0SignatureMsg nLockTime signedness
fab1572 test: Fix SegwitV0SignatureMsg nLockTime signedness (MarcoFalke) Pull request description: It is unsigned in Bitcoin Core, so the tests should match it: https://github.com/bitcoin/bitcoin/blob/5b8990a1f3c49b0b02b7383c69e95320acbda13e/src/script/interpreter.cpp#L1611 The bug was introduced when the code was written in 330b0f3. (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters) ACKs for top commit: epiccurious: Tested ACK fab1572. Eunovo: Tested ACK bitcoin@fab1572 achow101: ACK fab1572 Tree-SHA512: 68cb8582f6af22e6abb2fc9d6770277501baa0f9873e2e8d47699e87096fc5d4b9de45fa07199757b6e945c99d4c4ea95f01478322f2c093ef95cf5e0c78522b
2 parents 2ac41ef + fab1572 commit 88b1229

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/functional/test_framework/script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ def SegwitV0SignatureMsg(script, txTo, inIdx, hashtype, amount):
747747
ss += struct.pack("<q", amount)
748748
ss += struct.pack("<I", txTo.vin[inIdx].nSequence)
749749
ss += ser_uint256(hashOutputs)
750-
ss += struct.pack("<i", txTo.nLockTime)
750+
ss += txTo.nLockTime.to_bytes(4, "little")
751751
ss += struct.pack("<I", hashtype)
752752
return ss
753753

0 commit comments

Comments
 (0)