commit c4c816513b1d39bb542c8e1b4d9811a0d4725213
parent 7746f281eca41c9124eb4c0e0dd154b63f834bb0
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Tue, 21 Jul 2026 14:19:56 +0200
small bug fixing
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_post-private-orders.c b/src/backend/taler-merchant-httpd_post-private-orders.c
@@ -1587,8 +1587,9 @@ add_family_key (void *cls,
return;
for (unsigned int i = 0; i<family->keys_len; i++)
{
- if (TALER_token_issue_pub_cmp (&family->keys[i].pub,
- &tfkd->pub))
+ /* Note: cmp() returns 0 when the keys are EQUAL (memcmp-style). */
+ if (0 == TALER_token_issue_pub_cmp (&family->keys[i].pub,
+ &tfkd->pub))
{
/* A matching key is already in the list. */
return;
@@ -1819,10 +1820,13 @@ add_output_token_family (struct OrderContext *oc,
(unsigned long long) valid_at.abs_time.abs_value_us,
NULL == key_details.pub.public_key ? "no key" : "a key");
+ /* add_family_key() must run even if the family already exists, else a
+ DB-only key would never reach the in-memory family and the
+ find_key_index() assertion below aborts the backend (SIGABRT). */
+ add_family_key (oc,
+ &key_details);
if (NULL == family)
{
- add_family_key (oc,
- &key_details);
family = find_family (oc,
slug);
GNUNET_assert (NULL != family);
diff --git a/src/backenddb/sql-schema/drop.sql b/src/backenddb/sql-schema/drop.sql
@@ -43,7 +43,7 @@ BEGIN
END
$$;
-DROP SCHEMA merchant CASCADE;
+DROP SCHEMA IF EXISTS merchant CASCADE;
-- And we're out of here...
COMMIT;