A window-fitter from Mansfield had three bags of cocaine stuffed down his socks when he was arrested, a court heard.
Ben Johnson, 23, had been detained by bouncers at the Industria bar on Leeming Street in the town centre.
The bouncers called the police and when he was charged, he found himself in breach of a suspended prison-sentence that had been imposed for another drugs offence.
Johnson, of Chesterfield Road South, pleaded guilty at Nottingham Crown Court to the breach and also to possessing cocaine at Industria on Friday, April 15.
After fining him £500, the judge, Recorder Simon King, told him: “This is an expensive habit that you’ve got. Get rid of it for your own good.”
Hannah Whelan, prosecuting, told the court that Johnson said he paid £120 for a total of four bags of cocaine, which were for his own personal use.
The previous conviction dated back to May 2014 when he was handed an 18-week jail term, suspended for two years, for possessing cannabis with intent to supply.
“This arrest arose when he himself called the police to his former home on Bancroft Lane in Mansfield,” said Miss Whelan.
“He had been the victim in an affray, which resulted from a drug deal that went wrong. While at his home, officers found five mature cannabis plants.”
Johnson’s barrister, Emma Coverley, mitigating, said the cannabis offences stemmed from financial difficulties he was having at the time.
But since then, he had been in a stable job, and there had been no other breaches of the suspended sentence.
The judge told Johnson: “You nearly made it to the end of the two years, but you need to understand that when a court makes an order of this sort, it is serious and it is necessary to comply with it.”