diff options
Diffstat (limited to 'src/exchangedb/exchange_do_batch_reserves_in_insert.sql')
-rw-r--r-- | src/exchangedb/exchange_do_batch_reserves_in_insert.sql | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql index 73947b4b9..4eec2e006 100644 --- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql +++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql @@ -22,7 +22,7 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_reserves_in_insert( IN in_credit_val INT8, IN in_credit_frac INT4, IN in_exchange_account_name VARCHAR, - IN in_exectution_date INT8, + IN in_execution_date INT8, IN in_wire_source_h_payto BYTEA, ---h_payto IN in_payto_uri VARCHAR, IN in_reserve_expiration INT8, @@ -39,10 +39,11 @@ DECLARE DECLARE curs_trans refcursor; BEGIN -ruuid= 0; -out_reserve_found = TRUE; -transaction_duplicate= TRUE; - --SIMPLE INSERT ON CONFLICT DO NOTHING + ruuid = 0; + out_reserve_found = TRUE; + transaction_duplicate = TRUE; + +--SIMPLE INSERT ON CONFLICT DO NOTHING INSERT INTO wire_targets (wire_target_h_payto ,payto_uri) @@ -97,7 +98,7 @@ transaction_duplicate= TRUE; ,in_credit_frac ,in_exchange_account_name ,in_wire_source_h_payto - ,in_expiration_date) + ,in_execution_date) ON CONFLICT DO NOTHING RETURNING reserve_pub) SELECT * FROM reserve_transaction; @@ -108,7 +109,9 @@ transaction_duplicate= TRUE; THEN -- HAPPY PATH THERE IS NO DUPLICATE TRANS transaction_duplicate = FALSE; - PERFORM pg_notify(in_notify, NULL); + EXECUTE FORMAT ( + 'NOTIFY %s' + ,in_notify); END IF; END IF; CLOSE curs_trans; |