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.
error = _("Unable to generate initial keys");
                        return nullptr;
                    }
                }
            }
        }
        if (chain) {
            Instance->chainStateFlushed(chain->getTipLocator());
        }
    } else if (_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
        // Make it impossible to disable private keys after creation
        error = strprintf(_("Error loading %s Private keys can only be disabled during creation"), File);
        return nullptr;
    } else if (Instance->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
        for (auto spk_man  Instance->GetActiveScriptPubKeyMans()) {
            if (spk_man->HavePrivateKeys()) {
                warnings.push_back(strprintf(_("Warning Private keys detected in  {%s} with disabled private keys"), File));
                break;
            }
        }
    }
    if (!args.GetArg("-addresstype", "").empty()) {
        stdoptional<OutputType> parsed = ParseOutputType(args.GetArg("-addresstype", ""));
        if (!parsed) {
            error = strprintf(_("Unknown address type '%s'"), args.GetArg("-addresstype", ""));
            return nullptr;
        }
        Instance->m_default_address_type = parsed.value();
    }
    if (!args.GetArg("-changetype", "").empty()) {