Is the barrel cut down? There is no bayonet lug and not enough barrel for the bayonet to fit. The date is very similar to that found on Massachusetts proved barrels, as it the "P" stamp but, under the Massachusetts proof law, it should be stamped with the prover's (the word they used at the time) initials and the date under "P M". The rest of the gun is completely consistent with a date in the mid-1820s. I suspect it was a musket and the muzzle has been bobbed.