From: Jonathan McDowell Date: Wed, 20 Nov 2013 02:44:39 +0000 (-0800) Subject: Don't end an existing transaction if trying to delete a non-existent key X-Git-Tag: onak-0.4.3~21 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=8aefbded3634aff93af5aa094094ca87c0e64239;p=onak.git Don't end an existing transaction if trying to delete a non-existent key The DB4 key deletion routine would always exit the current transaction if the key wasn't found, even if it had been called by another function which had entered the transaction. Only do so if the deletion routine itself is what caused the transaction to be started. --- diff --git a/keydb_db4.c b/keydb_db4.c index 43f1674..b36ce3f 100644 --- a/keydb_db4.c +++ b/keydb_db4.c @@ -772,7 +772,9 @@ static int db4_delete_key(struct onak_dbctx *dbctx, } if (db4_fetch_key_id(dbctx, keyid, &publickey, true) == 0) { - db4_endtrans(dbctx); + if (!intrans) { + db4_endtrans(dbctx); + } return 1; }