def target(self): return bits_to_target(self.bits)
def target(self): '''Returns the proof-of-work target based on the bits''' return bits_to_target(self.bits)
def difficulty(self): '''Returns the block difficulty based on the bits''' # note difficulty is (target of lowest difficulty) / (self's target) # lowest difficulty has bits that equal 0xffff001d return bits_to_target(bytes.fromhex('ffff001d')) / self.target()