|
@ -515,6 +515,7 @@ class Transaction: |
|
|
self._inputs = None |
|
|
self._inputs = None |
|
|
self._outputs = None |
|
|
self._outputs = None |
|
|
self.locktime = 0 |
|
|
self.locktime = 0 |
|
|
|
|
|
self.version = 1 |
|
|
|
|
|
|
|
|
def update(self, raw): |
|
|
def update(self, raw): |
|
|
self.raw = raw |
|
|
self.raw = raw |
|
@ -583,6 +584,7 @@ class Transaction: |
|
|
self._inputs = d['inputs'] |
|
|
self._inputs = d['inputs'] |
|
|
self._outputs = [(x['type'], x['address'], x['value']) for x in d['outputs']] |
|
|
self._outputs = [(x['type'], x['address'], x['value']) for x in d['outputs']] |
|
|
self.locktime = d['lockTime'] |
|
|
self.locktime = d['lockTime'] |
|
|
|
|
|
self.version = d['version'] |
|
|
return d |
|
|
return d |
|
|
|
|
|
|
|
|
@classmethod |
|
|
@classmethod |
|
@ -708,7 +710,7 @@ class Transaction: |
|
|
return s |
|
|
return s |
|
|
|
|
|
|
|
|
def serialize_preimage(self, i): |
|
|
def serialize_preimage(self, i): |
|
|
nVersion = int_to_hex(1, 4) |
|
|
nVersion = int_to_hex(self.version, 4) |
|
|
nHashType = int_to_hex(1, 4) |
|
|
nHashType = int_to_hex(1, 4) |
|
|
nLocktime = int_to_hex(self.locktime, 4) |
|
|
nLocktime = int_to_hex(self.locktime, 4) |
|
|
inputs = self.inputs() |
|
|
inputs = self.inputs() |
|
@ -733,7 +735,7 @@ class Transaction: |
|
|
return any(self.is_segwit_input(x) for x in self.inputs()) |
|
|
return any(self.is_segwit_input(x) for x in self.inputs()) |
|
|
|
|
|
|
|
|
def serialize(self, estimate_size=False, witness=True): |
|
|
def serialize(self, estimate_size=False, witness=True): |
|
|
nVersion = int_to_hex(1, 4) |
|
|
nVersion = int_to_hex(self.version, 4) |
|
|
nLocktime = int_to_hex(self.locktime, 4) |
|
|
nLocktime = int_to_hex(self.locktime, 4) |
|
|
inputs = self.inputs() |
|
|
inputs = self.inputs() |
|
|
outputs = self.outputs() |
|
|
outputs = self.outputs() |
|
|