aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-02-21 13:05:58 -0500
committerAva Chow <github@achow101.com>2024-02-21 13:16:51 -0500
commit88b1229c134fa006d9a57e908ebebec944419347 (patch)
tree3eb281825c0445156af8defccf85a8c937150703
parent2ac41ef15fa523aa381d2b866aaa233b874c42fe (diff)
parentfab15723b0518acbb1015e64df47dcac0187e92f (diff)
downloadbitcoin-88b1229c134fa006d9a57e908ebebec944419347.tar.xz
Merge bitcoin/bitcoin#29400: test: Fix SegwitV0SignatureMsg nLockTime signedness
fab15723b0518acbb1015e64df47dcac0187e92f 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 330b0f31ee5719d94f9e52dfc83c5d82168241f9. (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters) ACKs for top commit: epiccurious: Tested ACK fab15723b0518acbb1015e64df47dcac0187e92f. Eunovo: Tested ACK https://github.com/bitcoin/bitcoin/pull/29400/commits/fab15723b0518acbb1015e64df47dcac0187e92f achow101: ACK fab15723b0518acbb1015e64df47dcac0187e92f Tree-SHA512: 68cb8582f6af22e6abb2fc9d6770277501baa0f9873e2e8d47699e87096fc5d4b9de45fa07199757b6e945c99d4c4ea95f01478322f2c093ef95cf5e0c78522b
-rw-r--r--test/functional/test_framework/script.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index 78d8580794..3275517888 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -747,7 +747,7 @@ def SegwitV0SignatureMsg(script, txTo, inIdx, hashtype, amount):
ss += struct.pack("<q", amount)
ss += struct.pack("<I", txTo.vin[inIdx].nSequence)
ss += ser_uint256(hashOutputs)
- ss += struct.pack("<i", txTo.nLockTime)
+ ss += txTo.nLockTime.to_bytes(4, "little")
ss += struct.pack("<I", hashtype)
return ss