[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: towards real-time deposit audito
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: towards real-time deposit auditor: ideas |
Date: |
Fri, 03 Nov 2023 16:17:23 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 94e8ecf9 towards real-time deposit auditor: ideas
94e8ecf9 is described below
commit 94e8ecf90f4e66456aed4f15cece3ca3da81bf4c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Nov 3 16:17:20 2023 +0100
towards real-time deposit auditor: ideas
---
src/auditor/taler-helper-auditor-deposits.c | 21 +++++++++++++++++++++
src/auditordb/auditor-0001.sql | 7 +++++++
2 files changed, 28 insertions(+)
diff --git a/src/auditor/taler-helper-auditor-deposits.c
b/src/auditor/taler-helper-auditor-deposits.c
index fc739599..8ec2b223 100644
--- a/src/auditor/taler-helper-auditor-deposits.c
+++ b/src/auditor/taler-helper-auditor-deposits.c
@@ -30,6 +30,27 @@
#include "taler_signatures.h"
#include "report-lib.h"
+/*
+--
+-- SELECT serial_id,h_contract_terms,h_wire,merchant_pub ...
+-- FROM auditor.depoist_confirmations
+-- WHERE NOT ancient
+-- ORDER BY exchange_timestamp ASC;
+-- SELECT 1
+- FROM exchange.deposits dep
+ WHERE ($RESULT.contract_terms = dep.h_contract_terms) AND
($RESULT.h_wire = dep.h_wire) AND ...);
+-- IF FOUND
+-- DELETE FROM auditor.depoist_confirmations
+-- WHERE serial_id = $RESULT.serial_id;
+-- SELECT exchange_timestamp AS latest
+-- FROM exchange.deposits ORDER BY exchange_timestamp DESC;
+-- latest -= 1 hour; // time is not exactly monotonic...
+-- UPDATE auditor.deposit_confirmations
+-- SET ancient=TRUE
+-- WHERE exchange_timestamp < latest
+-- AND NOT ancient;
+*/
+
/**
* Return value from main().
diff --git a/src/auditordb/auditor-0001.sql b/src/auditordb/auditor-0001.sql
index b755da4b..e54641ac 100644
--- a/src/auditordb/auditor-0001.sql
+++ b/src/auditordb/auditor-0001.sql
@@ -296,11 +296,18 @@ CREATE TABLE IF NOT EXISTS deposit_confirmations
,exchange_sig BYTEA NOT NULL CHECK (LENGTH(exchange_sig)=64)
,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+ ,suppressed BOOLEAN NOT NULL DEFAULT FALSE,
+ ,ancient BOOLEAN NOT NULL DEFAULT FALSE,
,PRIMARY KEY
(h_contract_terms,h_wire,merchant_pub,exchange_sig,exchange_pub,master_sig)
);
COMMENT ON TABLE deposit_confirmations
IS 'deposit confirmation sent to us by merchants; we must check that the
exchange reported these properly.';
+CREATE INDEX IF NOT EXISTS auditor_deposit_confirmations_not_ancient
+ ON deposit_confirmations
+ (exchange_timestamp ASC)
+ WHERE NOT ancient;
+
CREATE TABLE IF NOT EXISTS auditor_predicted_result
(master_pub BYTEA NOT NULL CONSTRAINT master_pub_ref REFERENCES
auditor_exchanges(master_pub) ON DELETE CASCADE
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: towards real-time deposit auditor: ideas,
gnunet <=