The change in walletdb.cpp is easier to review ignoring whitespace.
This change is need to get rid of CWalletTx copy constructor.
This is a backport of Core PR9381 [3/5]
https://github.com/bitcoin/bitcoin/pull/9381/commits/65b9d8f8ddb5a838454efc8bdd6576f0deb65f6d
Depends on D9075