This is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/15464 | PR15464]]
`addWallet` is not modified because the return value is added back and used in [[https://github.com/bitcoin/bitcoin/pull/16963 | PR16963]] which was backported in D7699.