MCPcopy Create free account
hub / github.com/ElementsProject/elements / get_weight

Method get_weight

test/functional/test_framework/messages.py:1252–1255  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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)" \

Callers 7

run_testMethod · 0.95
run_testMethod · 0.45
test_block_relayMethod · 0.45
bulk_transactionFunction · 0.45

Calls 1

serializeMethod · 0.95

Tested by 4

test_block_relayMethod · 0.36