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

Method stream_serialize

bitcoin/net.py:154–167  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

152 return c
153
154 def stream_serialize(self, f):
155 f.write(struct.pack(b"<i", self.nVersion))
156 f.write(struct.pack(b"<q", self.nRelayUntil))
157 f.write(struct.pack(b"<q", self.nExpiration))
158 f.write(struct.pack(b"<i", self.nID))
159 f.write(struct.pack(b"<i", self.nCancel))
160 f.write(intVectorSerializer.serialize(self.setCancel))
161 f.write(struct.pack(b"<i", self.nMinVer))
162 f.write(struct.pack(b"<i", self.nMaxVer))
163 f.write(intVectorSerializer.serialize(self.setSubVer))
164 f.write(struct.pack(b"<i", self.nPriority))
165 f.write(VarStringSerializer.serialize(self.strComment))
166 f.write(VarStringSerializer.serialize(self.strStatusBar))
167 f.write(VarStringSerializer.serialize(self.strReserved))
168
169 def __repr__(self):
170 return "CUnsignedAlert(nVersion %d, nRelayUntil %d, nExpiration %d, nID %d, nCancel %d, nMinVer %d, nMaxVer %d, nPriority %d, strComment %s, strStatusBar %s, strReserved %s)" % (self.nVersion, self.nRelayUntil, self.nExpiration, self.nID, self.nCancel, self.nMinVer, self.nMaxVer, self.nPriority, self.strComment, self.strStatusBar, self.strReserved)

Callers 1

test_serializationMethod · 0.95

Calls 1

serializeMethod · 0.45

Tested by 1

test_serializationMethod · 0.76