trivial: Suggested cleanups to surrounding code
Summary:
https://github.com/bitcoin/bitcoin/pull/18982#pullrequestreview-416974841
This is a backport of core#18982 [2/2]
https://github.com/bitcoin/bitcoin/pull/18982/commits/7eaf86d3bfc83f2beb3ef449707d5156853126fb
Depends on D9962
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Subscribers: majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9963