rpc/mining: Use existing NodeContext
Summary:
Also pass in appropriate object to:
- GetNetworkHashPS
- [gG]enerateBlock{,s}
Also:
- Misc style/constness changes
This is a partial backport of core#21391
Depends on D11507
https://github.com/bitcoin/bitcoin/pull/21391/commits/60dc05afc6f6388c6f86729a0edd7cb69f1748e0
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D11511