A mutable CTxIn
| 191 | |
| 192 | @__make_mutable |
| 193 | class CMutableTxIn(CTxIn): |
| 194 | """A mutable CTxIn""" |
| 195 | __slots__ = [] |
| 196 | |
| 197 | def __init__(self, prevout=None, scriptSig=CScript(), nSequence = 0xffffffff): |
| 198 | if not (0 <= nSequence <= 0xffffffff): |
| 199 | raise ValueError('CTxIn: nSequence must be an integer between 0x0 and 0xffffffff; got %x' % nSequence) |
| 200 | self.nSequence = nSequence |
| 201 | |
| 202 | if prevout is None: |
| 203 | prevout = CMutableOutPoint() |
| 204 | self.prevout = prevout |
| 205 | self.scriptSig = scriptSig |
| 206 | |
| 207 | @classmethod |
| 208 | def from_txin(cls, txin): |
| 209 | """Create a fully mutable copy of an existing TxIn""" |
| 210 | prevout = CMutableOutPoint.from_outpoint(txin.prevout) |
| 211 | return cls(prevout, txin.scriptSig, txin.nSequence) |
| 212 | |
| 213 | |
| 214 | class CTxOut(ImmutableSerializable): |
no outgoing calls