code: function readMaxSpendableMcIndex(conn, type, handleMaxSpendableMcIndex){
  	var table = type + '_outputs';
  	conn.query("SELECT MAX(main_chain_index) AS max_mc_index FROM "+table, function(rows){
  		var max_mc_index = rows[0].max_mc_index || 0;
  		handleMaxSpendableMcIndex(max_mc_index);
  	});
  }
docs: /*
  function readNextUnspentMcIndex(conn, type, address, handleNextUnspentMcIndex){
  var table = type + '_outputs';
  conn.query(
  "SELECT main_chain_index FROM "+table+" WHERE address=? AND is_spent=1 \n\
  ORDER BY main_chain_index DESC LIMIT 1", [address],
  function(rows){
  handleNextUnspentMcIndex((rows.length > 0) ? (rows[0].main_chain_index+1) : 0);
  }
  );
  }