Some lines were removed erroneously in D2111
Also backports:
- Missing change from PR10155: https://github.com/bitcoin/bitcoin/pull/10155/commits/08d9aee3ebc2c2401c4137e0575bdbbe056f5cae
- Build fix PR10168: https://github.com/bitcoin/bitcoin/pull/10168/files