If a judge of any court, or a justice court judge, or attorney-general or district attorney, or a constable, sheriff, or any person charged by law with the custody of public money, shall violate the provisions of the foregoing section, such person so offending, on conviction thereof, shall be fined Five Hundred Dollars ($500.00), and be imprisoned in the county jail twenty (20) days. In case any public officer shall in any manner use or loan public money in his hands by virtue of his office, in any game, wager, or bet, on conviction thereof, his commission shall thereby be deemed vacated, and the vacancy supplied as in case of death, resignation, or removal from office.