MCPcopy
hub / github.com/petertodd/python-bitcoinlib / CMutableTxIn

Class CMutableTxIn

bitcoin/core/__init__.py:193–211  ·  view source on GitHub ↗

A mutable CTxIn

Source from the content-addressed store, hash-verified

191
192@__make_mutable
193class 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
214class CTxOut(ImmutableSerializable):

Callers 6

fundrawtransactionMethod · 0.90
test_GetHashMethod · 0.85
test_is_coinbaseMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_GetHashMethod · 0.68
test_is_coinbaseMethod · 0.68