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

Method __init__

bitcoin/core/__init__.py:350–363  ·  view source on GitHub ↗

Create a new transaction vin and vout are iterables of transaction inputs and outputs respectively. If their contents are not already immutable, immutable copies will be made.

(self, vin=(), vout=(), nLockTime=0, nVersion=1, witness=CTxWitness())

Source from the content-addressed store, hash-verified

348 __slots__ = ['nVersion', 'vin', 'vout', 'nLockTime', 'wit']
349
350 def __init__(self, vin=(), vout=(), nLockTime=0, nVersion=1, witness=CTxWitness()):
351 """Create a new transaction
352
353 vin and vout are iterables of transaction inputs and outputs
354 respectively. If their contents are not already immutable, immutable
355 copies will be made.
356 """
357 if not (0 <= nLockTime <= 0xffffffff):
358 raise ValueError('CTransaction: nLockTime must be in range 0x0 to 0xffffffff; got %x' % nLockTime)
359 object.__setattr__(self, 'nLockTime', nLockTime)
360 object.__setattr__(self, 'nVersion', nVersion)
361 object.__setattr__(self, 'vin', tuple(CTxIn.from_txin(txin) for txin in vin))
362 object.__setattr__(self, 'vout', tuple(CTxOut.from_txout(txout) for txout in vout))
363 object.__setattr__(self, 'wit', CTxWitness.from_txwitness(witness))
364
365 @classmethod
366 def stream_deserialize(cls, f):

Callers

nothing calls this directly

Calls 5

CTxWitnessClass · 0.85
__setattr__Method · 0.80
from_txwitnessMethod · 0.80
from_txinMethod · 0.45
from_txoutMethod · 0.45

Tested by

no test coverage detected