gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: on idempotent deposit, just skip


From: gnunet
Subject: [taler-exchange] branch master updated: on idempotent deposit, just skip most of the transaction
Date: Sun, 19 Feb 2023 21:46:17 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 13d90bb1 on idempotent deposit, just skip most of the transaction
13d90bb1 is described below

commit 13d90bb1a3962272d82da47aa5e193103a2014ae
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Feb 19 21:46:15 2023 +0100

    on idempotent deposit, just skip most of the transaction
---
 src/exchangedb/exchange_do_purse_deposit.sql |  7 +++++++
 src/testing/test_exchange_p2p.c              | 10 +++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/exchangedb/exchange_do_purse_deposit.sql 
b/src/exchangedb/exchange_do_purse_deposit.sql
index 7ea426b7..d710e900 100644
--- a/src/exchangedb/exchange_do_purse_deposit.sql
+++ b/src/exchangedb/exchange_do_purse_deposit.sql
@@ -67,6 +67,7 @@ IF NOT FOUND
 THEN
   -- Idempotency check: check if coin_sig is the same,
   -- if so, success, otherwise conflict!
+
   PERFORM
   FROM exchange.purse_deposits
   WHERE coin_pub = in_coin_pub
@@ -79,6 +80,12 @@ THEN
     out_late=FALSE;
     out_conflict=TRUE;
     RETURN;
+  ELSE
+    -- Deposit exists, do not count for balance. Allow.
+    out_late=FALSE;
+    out_balance_ok=TRUE;
+    out_conflict=FALSE;
+    RETURN;
   END IF;
 END IF;
 
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index 6eea4a0b..329ed269 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2014--2022 Taler Systems SA
+  Copyright (C) 2014--2023 Taler Systems SA
 
   TALER is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as
@@ -250,6 +250,14 @@ run (void *cls,
       "withdraw-coin-1",
       "EUR:1.01",
       NULL),
+    TALER_TESTING_cmd_purse_deposit_coins (
+      "purse-deposit-coins-idempotent-but-gone",
+      MHD_HTTP_GONE,
+      0 /* min age */,
+      "purse-create-with-reserve",
+      "withdraw-coin-1",
+      "EUR:1.01",
+      NULL),
     TALER_TESTING_cmd_purse_poll_finish (
       "pull-deposit-purse-poll-finish",
       GNUNET_TIME_relative_multiply (

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]