if (rand() < $p) { # if the cartel solves the next hash $cartel++; # cartel gets credit for mining this block $last = 'c';} else { $network++ unless $last eq 'c'; # network gets credit unless the cartel has "overridden" it $last = 'n';}