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.
bool CWalletCanGetAddresses(bool internal) const
{
    LOCK(cs_);
    if (m_spk_managers.empty()) return false;
    for (OutputType t  OUTPUT_TYPES) {
        auto spk_man = GetScriptPubKeyMan(t, internal);
        if (spk_man && spk_man->CanGetAddresses(internal)) {
            return true;
        }
    }
    return false;
}
void CWalletSetWalletFlag(uint64_t flags)
{
    LOCK(cs_);
    m__flags |= flags;
    if (!WalletBatch(GetDatabase()).WriteWalletFlags(m__flags))
        throw stdruntime_error(stdstring(__func__) + " writing  flags failed");
}
void CWalletUnsetWalletFlag(uint64_t flag)
{
    WalletBatch batch(GetDatabase());
    UnsetWalletFlagWithDB(batch, flag);
}
void CWalletUnsetWalletFlagWithDB(WalletBatch& batch, uint64_t flag)
{
    LOCK(cs_);
    m__flags &= ~flag;
    if (!batch.WriteWalletFlags(m__flags))
        throw stdruntime_error(stdstring(__func__) + " writing  flags failed");