aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index b01b550ce..9edf69382 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -93,6 +93,7 @@ static int in_transaction;
static void open_db(void);
static void migrate_from_v2 (void);
+static void create_hashtable (TRUSTREC *vr, int type);
static int
take_write_lock (void)
@@ -469,6 +470,10 @@ create_version_record (void)
rc = tdbio_write_record( &rec );
if( !rc )
tdbio_sync();
+
+ if (!rc)
+ create_hashtable (&rec, 0);
+
return rc;
}
@@ -760,8 +765,6 @@ get_trusthashrec(void)
if( rc )
log_fatal( _("%s: error reading version record: %s\n"),
db_name, g10_errstr(rc) );
- if( !vr.r.ver.trusthashtbl )
- create_hashtable( &vr, 0 );
trusthashtbl = vr.r.ver.trusthashtbl;
}