@@ -339,10 +339,10 @@ def check_pow(self, nonce=None, debugmode=False):
339
339
mining_output = hashimoto_light (current_full_size , cache , header_hash , nonce )
340
340
diff = self .difficulty
341
341
if debugmode :
342
- print 'Mining hash: %s' % encode_hex (header_hash )
343
- print 'Seed: %s' % encode_hex (seed )
344
- print 'Mixhash: %s' % encode_hex (mining_output ['mix digest' ])
345
- print 'Result: %s' % encode_hex (mining_output ['result' ])
342
+ print ( 'Mining hash: {}' . format ( encode_hex (header_hash )) )
343
+ print ( 'Seed: {}' . format ( encode_hex (seed )) )
344
+ print ( 'Mixhash: {}' . format ( encode_hex (mining_output ['mix digest' ])) )
345
+ print ( 'Result: {}' . format ( encode_hex (mining_output ['result' ])) )
346
346
if mining_output ['mix digest' ] != self .mixhash :
347
347
return False
348
348
return utils .big_endian_to_int (mining_output ['result' ]) <= 2 ** 256 / (diff or 1 )
@@ -492,7 +492,7 @@ def __init__(self, header, transaction_list=[], uncles=[], db=None,
492
492
state_unknown = (header .prevhash != GENESIS_PREVHASH and
493
493
header .state_root != trie .BLANK_ROOT and
494
494
(len (header .state_root ) != 32 or
495
- 'validated:' + self .hash not in db ) and
495
+ b 'validated:' + self .hash not in db ) and
496
496
not making )
497
497
if state_unknown :
498
498
assert transaction_list is not None
@@ -566,7 +566,7 @@ def must_le(what, a, b):
566
566
"database" % self )
567
567
if (not self .is_genesis () and self .nonce and not self .header .check_pow ()):
568
568
raise ValueError ("PoW check failed" )
569
- self .db .put ('validated:' + self .hash , '1' )
569
+ self .db .put (b 'validated:' + self .hash , '1' )
570
570
571
571
@classmethod
572
572
def init_from_header (cls , header_rlp , db ):
0 commit comments