All of the above is true. And there is more:
Other items that must be measured and calculated in a joint are the size of the rivets, the tensile and shear strength of the rivets, and the pitch, or spacing of the rivets. Also, the size and number of reinforcing plates on the joint. Some have single, some have double and some have triple reinforcing plates. Today, the technology is available to examine the rivets and plates under a reinforcing plate to look for wastage, cracks and etc. that could not be done without taking it all apart in years gone by.
As Earl noted, some states exercise jurisdiction over locomotive boilers when FRA chooses not to exercise said jurisdiction. some states choose to apply state boiler regs that are made for all kinds of boilers and pressure vessels EXCEPT locomotive boilers, and this can cause problems. FRA's rules are based on ASME locomotive boiler construction codes and NBIC inspection and maintenance codes just for locomotive boilers.
Just because the locomotive ran for 40 years and nothing happened doesn't mean it was in compliance for any or all of those years, either. In general, the older locomotive boilers were designed with a lot of "overkill" in them, since the art of design was still based on a lot of guesswork, and the rule of thumb was, "when it doubt, make it stronger." IOW, though built to operate at 200 pounds MAWP, the boiler was actually good for 250 or so. This is the same philosophy that makes it possible for railroad bridges that were built 90 years ago in a time of 35-ton cars to handle today's 143-ton cars.
It is interesting to note that most of the largest, most modern steam locomotives were designed and built much closer to the edge. There was little or no overkill (or leeway) built into them, and thus there was very little allowance for wastage or wear. There were some large, modern locomotives built that operated at 300 pounds MAWP, but when the numbers are crunched, you find that the design was only good for about 305 pounds MAWP, so all it takes is a very slight amount of wastage to put those boilers out of business, or require them to be derated. I know of one railroad that had a class of 4-8-4's that were designed in such a manner that they had no leeway at all in the design, and that lead to a massive battle with the builder, who was not at all happy about cutting it so close.