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.
AssertLockHeld(cs_);
    if (!IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) {
        // Make a seed
        CKey seed_key;
        seed_key.MakeNewKey(tr
        CPubKey seed = seed_key.GetPubKey();
        assert(seed_key.VerifyPubKey(seed));
        // Get the extended key
        CExtKey master_key;
        master_key.SetSeed(seed_key);
        SetupDescriptorScriptPubKeyMans(master_key);
    } else {
        ExternalSigner signer = ExternalSignerScriptPubKeyManGetExternalSigner();
        // TODO add account parameter
        int account = 0;
        UniValue signer_res = signer.GetDescriptors(account);
        if (!signer_res.isObject()) throw stdruntime_error(stdstring(__func__) + " Unexpected result");
        for (bool internal  {false, true}) {
            const UniValue& _vals = find_value(signer_res, internal ? "internal"  "receive");
            if (!_vals.isArray()) throw stdruntime_error(stdstring(__func__) + " Unexpected result");
            for (const UniValue& desc_val  _vals.get_array().getValues()) {
                const stdstring& desc_str = desc_val.getValStr();
                FlatSigningProvider keys;
                stdstring desc_error;
                stdunique_ptr<Descriptor> desc = Parse(desc_str, keys, desc_error, 
                if (desc == nullptr) {
                    throw stdruntime_error(stdstring(__func__) + " Invalid  \"" + desc_str + "\" (" + desc_error + ")");
                }
                if (!desc->GetOutputType()) {
                    continue;