(self, f, include_witness=True)
| 396 | |
| 397 | |
| 398 | def stream_serialize(self, f, include_witness=True): |
| 399 | f.write(struct.pack(b"<i", self.nVersion)) |
| 400 | if include_witness and not self.wit.is_null(): |
| 401 | assert(len(self.wit.vtxinwit) <= len(self.vin)) |
| 402 | f.write(b'\x00') # Marker |
| 403 | f.write(b'\x01') # Flag |
| 404 | VectorSerializer.stream_serialize(CTxIn, self.vin, f) |
| 405 | VectorSerializer.stream_serialize(CTxOut, self.vout, f) |
| 406 | self.wit.stream_serialize(f) |
| 407 | else: |
| 408 | VectorSerializer.stream_serialize(CTxIn, self.vin, f) |
| 409 | VectorSerializer.stream_serialize(CTxOut, self.vout, f) |
| 410 | f.write(struct.pack(b"<I", self.nLockTime)) |
| 411 | |
| 412 | def is_coinbase(self): |
| 413 | return len(self.vin) == 1 and self.vin[0].prevout.is_null() |
nothing calls this directly
no test coverage detected