Merge bitcoin/bitcoin#29400: test: Fix SegwitV0SignatureMsg nLockTime signedness

fab15723b0 test: Fix SegwitV0SignatureMsg nLockTime signedness (MarcoFalke)

Pull request description:

  It is unsigned in Bitcoin Core, so the tests should match it:

  5b8990a1f3/src/script/interpreter.cpp (L1611)

  The bug was introduced when the code was written in 330b0f31ee.

  (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters)

ACKs for top commit:
  epiccurious:
    Tested ACK fab15723b0.
  Eunovo:
    Tested ACK fab15723b0
  achow101:
    ACK fab15723b0

Tree-SHA512: 68cb8582f6af22e6abb2fc9d6770277501baa0f9873e2e8d47699e87096fc5d4b9de45fa07199757b6e945c99d4c4ea95f01478322f2c093ef95cf5e0c78522b
pull/29462/head
Ava Chow 9 months ago
commit 88b1229c13
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

@ -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

Loading…
Cancel
Save