I skipped this commit (https://github.com/bitcoin/bitcoin/pull/15288/commits/cc02c796d3517931acc861b0f9bc50e36e1c95f9) backporting [[https://github.com/bitcoin/bitcoin/pull/15288 | PR15288]]
because we don't use Core's 'smart fee' functionality but later realized that the references to g_mempool in wallet/wallet.cpp still needed
to be moved to prevent problems with further refactorings. Tried to keep this change as close as possible to the original commit.