The court heard that police had received information that Martin Blain, 34, of 24 Bayview Road had been concerned in supplying the drug for some time.
They executed a search warrant on the home of the father-of-two, which he shares with his partner and sometimes his children, on November 26. They found a bag of brown powder in his bedside drawer which tested as the heroin, and £600 in cash.
The court heard that Blain served a previous sentence for similar offences in 1999.
Sheriff Kenneth Robb told Blain: “Even knowing you had a previous conviction, you still got yourself involved in the supply of drugs again.”
Rapist Pedley behind bars for seven years
Bodycam footage shows police breaking into hot car to free distressed dog stuck in high temperatures
Cree Bridge bi-centenary comes about
New recycling service gets off to strong start, but be careful what you put in your bin
Girls were '˜groomed' online
Blain was sent to jail with his sentence backdated to November 26.