In 7740cd59966a90a388ae93a4ba7a040f6f08a250 “test: add coverage for migrating ancient wallets”
erase_bdb_record erases the first instance of bestblock here. However, there are actually 2 bestblock records, bestblock and bestblock_nomerkle. In most cases, this is probably erasing (the first part of) bestblock_nomerkle and leaving bestblock intact. So strictly speaking, this test is not testing pre #152 wallets, but rather a bit of a corruption case where bestblock is empty, but bestblock_nomerkle doesn’t exist.
This should probably erase bestblock_nomerkle first.