Much more robust and correct way of calculating local weight and estimating staking time.