bcf41438dc
* Go back to db for head and header_head * Use batch consistently for db access * Pass active txhashset and batch in the ctx * Only update head in db if total work increases * Only updated header_head if total work (on header chain) increases