| 803 | "wit") |
| 804 | |
| 805 | def __init__(self, tx=None): |
| 806 | if tx is None: |
| 807 | self.nVersion = 2 |
| 808 | self.vin = [] |
| 809 | self.vout = [] |
| 810 | self.wit = CTxWitness() |
| 811 | self.nLockTime = 0 |
| 812 | self.sha256 = None |
| 813 | self.hash = None |
| 814 | else: |
| 815 | self.nVersion = tx.nVersion |
| 816 | self.vin = copy.deepcopy(tx.vin) |
| 817 | self.vout = copy.deepcopy(tx.vout) |
| 818 | self.nLockTime = tx.nLockTime |
| 819 | self.sha256 = tx.sha256 |
| 820 | self.hash = tx.hash |
| 821 | self.wit = copy.deepcopy(tx.wit) |
| 822 | |
| 823 | def deserialize(self, f): |
| 824 | self.nVersion = struct.unpack("<i", f.read(4))[0] |