Isn't chainActive here and a few lines below accessed without cs_main?