MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / is_valid

Method is_valid

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

Source from the content-addressed store, hash-verified

839 return self.get_merkle_root(hashes)
840
841 def is_valid(self):
842 target = uint256_from_compact(self.nBits)
843 if self.hash_int > target:
844 return False
845 for tx in self.vtx:
846 if not tx.is_valid():
847 return False
848 if self.calc_merkle_root() != self.hashMerkleRoot:
849 return False
850 return True
851
852 def solve(self):
853 target = uint256_from_compact(self.nBits)

Callers 1

test_basicMethod · 0.95

Calls 2

calc_merkle_rootMethod · 0.95
uint256_from_compactFunction · 0.85

Tested by 1

test_basicMethod · 0.76