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:
@@ -1410,7 +1410,7 @@ class TaprootTest(BitcoinTestFramework):
|
||||
while left:
|
||||
# Construct CTransaction with random nVersion, nLocktime
|
||||
tx = CTransaction()
|
||||
tx.nVersion = random.choice([1, 2, random.randint(-0x80000000, 0x7fffffff)])
|
||||
tx.nVersion = random.choice([1, 2, random.getrandbits(32)])
|
||||
min_sequence = (tx.nVersion != 1 and tx.nVersion != 0) * 0x80000000 # The minimum sequence number to disable relative locktime
|
||||
if random.choice([True, False]):
|
||||
tx.nLockTime = random.randrange(LOCKTIME_THRESHOLD, self.lastblocktime - 7200) # all absolute locktimes in the past
|
||||
|
||||
Reference in New Issue
Block a user