Right now to recover from a backup with an encrypted HD wallet the user must do something like unlock the wallet with a really long time out and manually trigger a rescan,  otherwise they risk missing some keys when auto-topup cannot run.
#include <chain.h>
#include <clientversion.h>
#include <core_io.h>
#include <fs.h>
#include <hash.h>
#include <interfaces/chain.h>
#include <key_io.h>
#include <merkleblock.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <script/standard.h>
#include <sync.h>
#include <uint256.h>
#include <util/bip32.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/rpc/util.h>
#include <wallet/wallet.h>
#include <cstdint>
#include <fstream>
#include <tuple>
#include <string>
#include <univalue.h>
using interfaces::FoundBlock;
 {
std::string static EncodeDumpString(const std::string &str) {