BOSTON (Reuters) - A federal judge on Friday sentenced former Massachusetts House Speaker Salvatore DiMasi to eight years in prison after his conviction on corruption charges, a Justice Department spokeswoman said. DiMasi could have received up to 20 years in prison. He had asked for leniency, based on his record of public service. DiMasi, a Democrat, was the third consecutive House speaker in Massachusetts to be found guilty of a felony. He held the legislative post from 2004 until he resigned under pressure at the start of 2009. In June a Boston jury found DiMasi guilty of conspiring to help a software company win state contracts in exchange for kickbacks.