aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/tdbio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 5c2fdd14d..725c3c2ca 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -92,6 +92,7 @@ static int db_fd = -1;
static int in_transaction;
static void open_db(void);
+static void create_hashtable (TRUSTREC *vr, int type);
static int
take_write_lock (void)
@@ -471,6 +472,10 @@ create_version_record (void)
rc = tdbio_write_record( &rec );
if( !rc )
tdbio_sync();
+
+ if (!rc)
+ create_hashtable (&rec, 0);
+
return rc;
}
@@ -763,8 +768,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;
}