In the 19th Century, piracy was an ever present danger to merchant ships. When pirates would take over a ship, the Captain, crew and any passengers were often murdered so there would be no witnesses to testify against the pirates IF they were ever captured. Hence, even merchant ships carried arms that could be issued out to the crew in an emergency to "repel boarders" if their ship was overtaken and grappled by a pirate vessel.
Typically, some of the sailors were armed with four or five single shot pistols in addition to their cutlasses-as I said, it was usually a "Fight to the death." Ship Chandlers often sold inexpensive pistols and muskets to equip ship armories on merchant vessels. My guess that this pistol was at one time, part of a ships armory.
My, My, how "times have changed." About 20 years ago there was a meeting of British ship owners with members of the government along with Nautical insurance companies representatives in London. The topic of discussion was how to stop piracy of British flagged vessels off the coast of Africa and in the waters off of Southeast Asia.
The idiotic "solution" reached to repel pirates was the recommendation that the crew of the vessel being attacked use FIRE HOSES to repel AK-47 and RPG armed pirates. My opinion is that bringing a Fire Hose to a Gun Fight is worse than bringing a knife to a gun fight!!!