commit 4cff45dbf755c8a1201639b15ddd2d2004cbab02
parent 412f48544a0cca5e8e273a5772ef99b47bf74280
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 3 Feb 2026 09:47:44 +0100
DB schema changes for #9961
Diffstat:
3 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/src/backenddb/merchant-0030.sql b/src/backenddb/merchant-0030.sql
@@ -0,0 +1,50 @@
+--
+-- This file is part of TALER
+-- Copyright (C) 2026 Taler Systems SA
+--
+-- TALER is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 3, or (at your option) any later version.
+--
+-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+-- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License along with
+-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+
+-- @file merchant-0029.sql
+-- @brief Add field for long-poll signalling to taler-merchant-kyccheck
+-- @author Christian Grothoff
+
+BEGIN;
+
+-- Check patch versioning is in place.
+SELECT _v.register_patch('merchant-0030', NULL, NULL);
+
+SET search_path TO merchant;
+
+CREATE TABLE IF NOT EXISTS merchant_unclaim_signatures
+ (unclaim_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ ,h_contract_terms BYTEA PRIMARY KEY CHECK (LENGTH(h_contract_terms)=64)
+ ,unclaim_sig BYTEA NOT NULL CHECK (LENGTH(unclaim_sig)=64)
+ ,expiration_time INT8 NOT NULL
+);
+
+COMMENT ON TABLE merchant_unclaim_signatures
+ IS 'Here we store proofs of wallets unclaiming a claim to a contract. Right now not really used, but theoretically legally important as this shows that the wallet was the one abandoing its rights to the proposal.';
+COMMENT ON COLUMN merchant_unclaim_signatures.h_contract_terms
+ IS 'Hash over the contract terms of the unclaimed contract';
+COMMENT ON COLUMN merchant_unclaim_signatures.unclaim_sig
+ IS 'Signature of purpose CONTRACT_UNCLAIM';
+COMMENT ON COLUMN merchant_unclaim_signatures.expiration_time
+ IS 'Payment deadline of the original contract, at this point we should be OK to delete the unclaim signature via garbage collection.';
+
+
+CREATE INDEX merchant_unclaim_signatures_by_expiration
+ ON merchant_unclaim_signatures
+ (expiration_time);
+COMMENT ON INDEX merchant_unclaim_signatures_by_expiration
+ IS 'For garbage collection of unclaim signatrues after payment deadlines have been passed.';
+
+COMMIT;
diff --git a/src/backenddb/procedures.sql.in b/src/backenddb/procedures.sql.in
@@ -49,6 +49,8 @@ BEGIN
DELETE FROM tan_challenges
WHERE expiration_date < in_now;
+ DELETE FROM merchant_unclaim_signatures
+ WHERE expiration_time < in_now;
END $$;
COMMENT ON PROCEDURE merchant_do_gc
IS 'calls all other garbage collection subroutines';
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2025 Taler Systems SA
+ Copyright (C) 2014-2026 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software