Store block headers in database