Cache the result of chainparams.GetConsensus() in miner code
Summary: Calling the same function again and again is redudant.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D5234