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