(self)
| 1250 | # Calculate the block weight using witness and non-witness |
| 1251 | # serialization size (does NOT use sigops). |
| 1252 | def get_weight(self): |
| 1253 | with_witness_size = len(self.serialize(with_witness=True)) |
| 1254 | without_witness_size = len(self.serialize(with_witness=False)) |
| 1255 | return (WITNESS_SCALE_FACTOR - 1) * without_witness_size + with_witness_size |
| 1256 | |
| 1257 | def __repr__(self): |
| 1258 | return "CBlock(nVersion=%i hashPrevBlock=%064x hashMerkleRoot=%064x nTime=%s vtx=%s m_dynafed_params=%s)" \ |