def is_next_block_in_chain(height, v): ''' Returns true if the prev_hash of the block in v matches the hash of block with height-1''' if (height == 0): return True (blkhash, block_version, prev_hash, root, timestamp, target, nonce, txs), blk_size = load_block(v) actual_prev_hash = db.execute('SELECT hash FROM block WHERE height=?', (height - 1,)).fetchone()[0] return b2lx(prev_hash) == b2lx(actual_prev_hash)