A father-of-two caught twice dealing cannabis to clear his own drug debts had "peddled the misery" of addiction on to others, a court heard.
Keith Gilroy (26) had been a "good sportsman" before he got involved in drugs and the "hole he dug for himself got bigger and bigger".
Judge John Hughes jailed him for nine months, but the sentence is to run concurrently with a five-year prison term he is already serving for transporting a loaded revolver and possession of more than €40,000 worth of crack cocaine and cannabis.
Gilroy, from Bunratty Road, Coolock, pleaded guilty to possession of drugs for sale or supply.
Dublin District Court heard gardai saw Gilroy engaged in a suspicious transaction in the Store Street area on January 28, 2016. He was stopped and searched and found in possession of €200 worth of cannabis.
Gilroy had been involved in the drug trade to feed his own habit and discharge this debt, his solicitor Conor Ruane said.
He had been used by others for nefarious purposes, he said.
Gilroy was a passenger in a car that was stopped at another location in the north inner city on January 3, 2017.
He was found in possession of bags of cannabis worth a total of €1,550 and also had €235 in cash on him.
Gilroy had been given a five-year prison sentence at Dublin Circuit Criminal Court last February, the court heard.
That sentence - for transporting a gun and possession of more than €40,000 worth of drugs - was for offences in February 2017 and July 2018.
Gilroy became addicted to cannabis and "the hole he dug for himself got bigger and bigger," Mr Ruane said.
Things escalated and he ended up being incarcerated. He was an "extremely vulnerable young man" and had a "very rough time of it".
"It would appear that Mr Gilroy, like so many others, got involved in the drugs trade and he became an active part of the machine of selling and supplying drugs," the judge said.
Whatever the reason for this, he "sought to peddle this misery on to others," the judge said.