Optimize get_item_ids() to use block_ids looked up in the database instead of calculating them from scratch each time.
Don't try to provide sync data to any peer who provides us an unreasonably long blockchain synopsis (they either have a screwed up database or they're an attacker)