//get index
require('./../config');
async=require('async');
var bitcoin=require('bitcoin').bitcoin;
var knex=require('knex').knex;

//var bookshelf=require('bookshelf').bookshelf;

exports.index = function(req, res){
  testnet: async.parallel({
    testnet: function(callback){
      bitcoin.getInfo(function(e, info){
        if(e){ return console.log(e);}
        if(info.testnet){
          callback(null, 'bitcoin RPC is testnet');
        }else{
          callback(null, 'nope.. you must be crazy');
        }
      });
    },
    name: function(callback){
      var c=knex('config').select().then(function(r){
        callback(null, r[0].site_name);
      });
    }
  },
  function(err, r){
      res.render('index', { title: r.name, testnet: r.testnet });
  });
  
};
//get index
require('./../config');
var Promise = require("bluebird");

var bitcoin=require('bitcoin').bitcoin;
var knex=require('knex').knex;
Promise.promisifyAll(require('bitcoin').Client.prototype);
//var bookshelf=require('bookshelf').bookshelf;

exports.index = function(req, res){
  var info = bitcoin.getInfoAsync();
  var config = knex('config').select();
  Promise.all([info, config]).spread(function(info, config) {
      res.render('index', {
          title: config[0].site_name,
          testnet: info.testnet ? 'bitcoin RPC is testnet' : 'nope.. you must be crazy'
      });
    }).catch(function(e){
      console.log(e);
    });
};

Change to using promisify instead of async for better code and easy error handling