From 94e8ecf90f4e66456aed4f15cece3ca3da81bf4c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 3 Nov 2023 16:17:20 +0100 Subject: towards real-time deposit auditor: ideas --- src/auditordb/auditor-0001.sql | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/auditordb') diff --git a/src/auditordb/auditor-0001.sql b/src/auditordb/auditor-0001.sql index b755da4b0..e54641ac4 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 -- cgit v1.2.3