The retiring sheriff shall be entitled to retain only one half of the commission allowed by law on moneys collected and turned over to his successor under the provisions of §§ 8-9-30 and 8-9-40 and his successor the other half for paying out such moneys.