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.
using UpdateWalletTxFn = std::function<bool(CWalletTx& wtx, bool new_tx)>;
    /**
     * Add the transaction to the wallet, wrapping it up inside a CWalletTx
     * @return the recently added wtx pointer or nullptr if there was a db write error.
     */
    CWalletTx* AddToWallet(CTransactionRef tx, const TxState& state, const UpdateWalletTxFn& update_wtx=nullptr, bool fFlushOnClose=true, bool rescanning_old_block = false);
    bool LoadToWallet(const uint256& hash, const UpdateWalletTxFn& fill_wtx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
    void transactionAddedToMempool(const CTransactionRef& tx) override;
    void blockConnected(const interfaces::BlockInfo& block) override;
    void blockDisconnected(const interfaces::BlockInfo& block) override;
    void updatedBlockTip() override;
    int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update);
    struct ScanResult {
        enum { SUCCESS, FAILURE, USER_ABORT } status = SUCCESS;
        
        
        
        uint256 last_scanned_block;
        std::optional<int> last_scanned_height;
        
        
        
        
        uint256 last_failed_block;
    };
    ScanResult ScanForWalletTransactions(const uint256& start_block, int start_height, std::optional<int> max_height, const WalletRescanReserver& reserver, bool fUpdate, const bool save_progress);
    void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) override;
    
    void SetNextResend() { m_next_resend = GetDefaultNextResend(); }