commit 51a378827046235c874b865d8dcbc9dbaa626a10 parent ab00480dd9b3be50704fb449b750c764fd4c1de0 Author: Antoine A <> Date: Thu, 9 Jul 2026 08:57:12 +0200 common: fix prepared transfer db procedure Diffstat:
| M | database-versioning/libeufin-bank-procedures.sql | | | 4 | +++- |
| M | database-versioning/libeufin-nexus-procedures.sql | | | 4 | +++- |
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/database-versioning/libeufin-bank-procedures.sql b/database-versioning/libeufin-bank-procedures.sql @@ -783,7 +783,9 @@ IF out_pending THEN ELSE UPDATE prepared_transfers SET bank_transaction_id = out_credit_row_id - WHERE (bank_transaction_id IS NULL AND account_pub = in_metadata) OR authorization_pub = local_authorization_pub; + WHERE ( + bank_transaction_id IS NULL AND account_pub = in_metadata AND type='reserve' + ) OR authorization_pub = local_authorization_pub; IF local_withdrawal_uuid IS NOT NULL THEN PERFORM abort_taler_withdrawal(local_withdrawal_uuid); END IF; diff --git a/database-versioning/libeufin-nexus-procedures.sql b/database-versioning/libeufin-nexus-procedures.sql @@ -369,7 +369,9 @@ IF in_type IS NOT NULL AND NOT out_talerable AND out_bounce_id IS NULL THEN ELSE UPDATE prepared_transfers SET incoming_transaction_id = out_tx_id - WHERE (incoming_transaction_id IS NULL AND account_pub = in_metadata) OR authorization_pub = local_authorization_pub; + WHERE ( + incoming_transaction_id IS NULL AND account_pub = in_metadata AND type='reserve' + ) OR authorization_pub = local_authorization_pub; -- We cannot use ON CONFLICT here because conversion use a trigger before insertion that isn't idempotent INSERT INTO talerable_incoming_transactions ( incoming_transaction_id