Index: b/g10/tdbio.c =================================================================== --- b/g10/tdbio.c +++ b/g10/tdbio.c @@ -93,6 +93,7 @@ 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,8 @@ rc = tdbio_write_record( &rec ); if( !rc ) tdbio_sync(); + if (!rc) + create_hashtable (&rec, 0); return rc; } @@ -760,8 +763,6 @@ 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; }