aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/exchange-0001-part.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/exchange-0001-part.sql')
-rw-r--r--src/exchangedb/exchange-0001-part.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index 75f65ffb6..cc34b6be3 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -1040,6 +1040,21 @@ CREATE TABLE IF NOT EXISTS purse_requests_default
SELECT add_constraints_to_purse_requests_partition('default');
+-- ------------------------------ purse_refunds ----------------------------------------
+
+SELECT create_table_purse_refunds();
+
+COMMENT ON TABLE purse_refunds
+ IS 'Purses that were refunded due to expiration';
+COMMENT ON COLUMN purse_refunds.purse_pub
+ IS 'Public key of the purse';
+
+CREATE TABLE IF NOT EXISTS purse_refunds_default
+ PARTITION OF purse_refunds
+ FOR VALUES WITH (MODULUS 1, REMAINDER 0);
+
+SELECT add_constraints_to_purse_refunds_partition('default');
+
-- ------------------------------ purse_merges ----------------------------------------
@@ -3485,6 +3500,11 @@ UPDATE purse_requests
finished=TRUE
WHERE purse_pub=my_purse_pub;
+INSERT INTO purse_refunds
+ (purse_pub)
+ VALUES
+ (my_purse_pub);
+
-- restore balance to each coin deposited into the purse
FOR my_deposit IN
SELECT coin_pub