On the convergence of weighted-average consensus