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
2024-01-25 16:27:08 -05:00
parent 6e4d18f37f
commit 27e70f1f5b
16 changed files with 47 additions and 39 deletions

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)