Because of injury
,blood might have clotted in the finger.
It will subside spontaneously and gradually.
But,you have pricked the finger with unsterilised pin.
It might have cased infection.Sometimes,the blood clot can become infected even without injury.
I prescribe antibiotic like Clindamycin
,anti inflammatory medicine to my patients with similar complaints.
Please consult a surgeon and proceed
Wish you speedy recovery