mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
consensus: Store transaction nVersion as uint32_t
Given that the use of a transaction's nVersion is always as an unsigned int, it doesn't make sense to store it as signed and then cast it to unsigned.
This commit is contained in:
@@ -738,7 +738,7 @@ def SegwitV0SignatureMsg(script, txTo, inIdx, hashtype, amount):
|
||||
hashOutputs = uint256_from_str(hash256(serialize_outputs))
|
||||
|
||||
ss = bytes()
|
||||
ss += txTo.nVersion.to_bytes(4, "little", signed=True)
|
||||
ss += txTo.nVersion.to_bytes(4, "little")
|
||||
ss += ser_uint256(hashPrevouts)
|
||||
ss += ser_uint256(hashSequence)
|
||||
ss += txTo.vin[inIdx].prevout.serialize()
|
||||
@@ -817,7 +817,7 @@ def TaprootSignatureMsg(txTo, spent_utxos, hash_type, input_index = 0, scriptpat
|
||||
in_type = hash_type & SIGHASH_ANYONECANPAY
|
||||
spk = spent_utxos[input_index].scriptPubKey
|
||||
ss = bytes([0, hash_type]) # epoch, hash_type
|
||||
ss += txTo.nVersion.to_bytes(4, "little", signed=True)
|
||||
ss += txTo.nVersion.to_bytes(4, "little")
|
||||
ss += txTo.nLockTime.to_bytes(4, "little")
|
||||
if in_type != SIGHASH_ANYONECANPAY:
|
||||
ss += BIP341_sha_prevouts(txTo)
|
||||
|
||||
Reference in New Issue
Block a user