aboutsummaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-11-03 16:17:20 +0100
committerChristian Grothoff <christian@grothoff.org>2023-11-03 16:17:20 +0100
commit94e8ecf90f4e66456aed4f15cece3ca3da81bf4c (patch)
treee89921a0dd4d65b196f4c77c9bf20d47257fd451 /src/auditor
parentee57a5f9c481555d0462012439a99778a2dbcbcb (diff)
downloadexchange-94e8ecf90f4e66456aed4f15cece3ca3da81bf4c.tar.xz
towards real-time deposit auditor: ideas
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-helper-auditor-deposits.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/auditor/taler-helper-auditor-deposits.c b/src/auditor/taler-helper-auditor-deposits.c
index fc7395994..8ec2b223e 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().