weight and totalWeight are already uint ? and len() gives "int" which is just fine unless `40 * len(r.Nodes) * weight` > 2 billion ?