This ensures wallet code doesn't access node global state, avoiding bugs like
https://github.com/bitcoin/bitcoin/pull/15557#discussion_r267735431
---
Depends on D6255
Concludes backport of Core [[https://github.com/bitcoin/bitcoin/pull/15639 | PR15639]]