Sahih al-Bukhari Book 34, Hadith 55
Abu Taiba cupped Allah's Messenger (ﷺ) so he ordered that he be paid one Sa of dates and ordered his
masters to reduce his tax (as he was a slave and had to pay a tax to them).
Allah's Messenger (ﷺ) said, "The example of a good companion (who sits with you) in comparison with a bad one, is like that of the musk seller and the blacksmith's bellows (or furnace); from the first you would either buy musk or enjoy its good smell while the bellows would either burn your clothes or your house, or you get a bad nasty smell thereof."
Once the Prophet (ﷺ) got his blood out (medically) and paid that person who had done it. If it had been illegal, the Prophet (ﷺ) would not have paid him.