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:
Ava Chow committed 2024-06-07 12:40:21 -04:00
1 parent 6e4d18f37f
commit 27e70f1f5b
16 files changed
+47 -39

No files matched your search

+2 -2
View File
@@ -1164,7 +1164,7 @@ class SegWitTest(BitcoinTestFramework):
if not self.wit.is_null():
flags |= 1
r = b""
r += self.nVersion.to_bytes(4, "little", signed=True)
r += self.nVersion.to_bytes(4, "little")
if flags:
dummy = []
r += ser_vector(dummy)
@@ -1975,7 +1975,7 @@ class SegWitTest(BitcoinTestFramework):
def serialize_with_bogus_witness(tx):
flags = 3
r = b""
r += tx.nVersion.to_bytes(4, "little", signed=True)
r += tx.nVersion.to_bytes(4, "little")
if flags:
dummy = []
r += ser_vector(dummy)