diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-11-03 16:17:20 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-11-03 16:17:20 +0100 |
commit | 94e8ecf90f4e66456aed4f15cece3ca3da81bf4c (patch) | |
tree | e89921a0dd4d65b196f4c77c9bf20d47257fd451 /src/auditordb | |
parent | ee57a5f9c481555d0462012439a99778a2dbcbcb (diff) |
towards real-time deposit auditor: ideas
Diffstat (limited to 'src/auditordb')
-rw-r--r-- | src/auditordb/auditor-0001.sql | 7 |
1 files changed, 7 insertions, 0 deletions
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 |