https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
// 2. Path to an existing directory.
    // 3. Path to a symlink to a directory.
    // 4. For backwards compatibility, the name of a data file in -dir.
    const fspath _path = fsbridgeAbsPathJoin(GetWalletDir(), fsPathFromString(name));
    fsfile_type path_type = fssymlink_status(_path).type();
    if (!(path_type == fsfile_typenot_found || path_type == fsfile_typedirectory ||
          (path_type == fsfile_typesymlink && fsis_directory(_path)) ||
          (path_type == fsfile_typeregular && fsPathFromString(name).filename() == fsPathFromString(name)))) {
        error_string = Untranslated(strprintf(
              "Invalid - path '%s'. - path should point to a directory wher.dat and "
              "database/log.?????????? files can be stored, a location where such a directory could be created, "
              "or (for backwards compatibility) the name of an existing data file in -dir (%s)",
              name, fsquoted(fsPathToString(GetWalletDir()))));
        status = DatabaseStatusFAILED_BAD_PATH;
        return nullptr;
    }
    return MakeDatabase(_path, options, status, error_string);
}
stdshared_ptr<CWallet> CWalletCreate(WalletContext& context, const stdstring& name, stdunique_ptr<WalletDatabase> database, uint64_t _creation_flags, bilingual_str& error, stdvector<bilingual_str>& warnings)
{
    interfacesChain* chain = context.chain;
    ArgsManager& args = *Assert(context.args);
    const stdstring& File = database->Filename();
    int64_t nStart = GetTimeMillis();
    // TODO Can't use stdmake_shared because we need a custom deleter but
    // should be possible to use stdallocate_shared.
    const stdshared_ptr<CWallet> Instance(new CWallet(chain, name, args, stdmove(database)), ReleaseWallet);
    bool rescan_required = false;
    DBErrors nLoadWalletRet = Instance->LoadWallet();
    if (nLoadWalletRet != DBErrorsLOAD_OK) {