- config.dbbackend->initdb(true);
- inithash();
- wotsap(config.dbbackend->getfullkeyid(keyid), dir ? dir : ".");
- destroyhash();
- config.dbbackend->cleanupdb();
+ dbctx = config.dbinit(config.backend, true);
+ if (dbctx != NULL) {
+ inithash();
+ wotsap(dbctx, keyid, dir ? dir : ".");
+ destroyhash();
+ dbctx->cleanupdb(dbctx);
+ } else {
+ fprintf(stderr, "Couldn't initialize key database.\n");
+ }