What are the steps a SPV client takes in order to sync?
- Connect to a peer
- Set bloom filter for wallet addresses
- Download all block-headers since latest checkpoint
- Request every block again with filters set
- Update wallet balance based on returned blocks
Obviously the above steps are wrong since it makes no sense to first download all blockheaders to determine the correct chain, and then re-request all blocks to calculate the wallet balance.
But what is the correct procedure?