I am a Mortgage Loan Consultant and I have made it my area of expertise in working with people with bankruptcies, bad credit, and foreclosures. Firstly you do NOT have to wait 2 years to refinance after a chapter 7 discharge, those are for fannie Mae loans. You can refinance a chapter 7 a day after discharge. A chapter 13 can also be refinanced before discharge since it's on a payment plan for 3-5 years from filing date. You can get a chapter 13 refinance as little as 12 months from filing, not discharge and you can payoff your chapter 13 in the process if you have enough equity in your home. There are major differences between a chapter 13 and chapter 7 refinance but that is for your mortgage broker to be aware of.
I work in conjunction with a mortgage broker who is able to get financing for people 12 months out of bankruptcy.
I filed bankruptcy in august of 03 and here it is may of 04. I raised my credit scores higher than they were before i filed bankruptcy, but they are still too low. You will only get a mortgage for 70-80% (20-30%down) if you only wait a year. If you wait until it is discharged for 2 years, you will save a ton of money on the downpayment AND on interest. After you file bankruptcy, you need to write letters to everyone you were discharged, so they put on there that you have a zero balance. Keep track of all of this. It is very stressful, but it works.
There are several sub-prime mortgage companies who will lend to borrowers one day out of bankruptcy (one day after your discharge).