bitcoin/bitcoin — pull request #2295 by sipa (2013-02-10 19:51:29+00:00)
Title: Add script to clean up datadirs

It tries to detect the version of the client last used on the datadir, and only removes files that are not in use by that version or any later versions.