summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-03-12 11:33:10 +0100
committerChristian Grothoff <christian@grothoff.org>2018-03-12 11:33:10 +0100
commita166ca7fece8bbe3c66dcf0217cc81d20d185ab0 (patch)
treeb9cf10b1034e3f1d4d9c367ef2faa7e6bd206404 /src/auditor
parent1ae2ba3d0a035734e4a28432e3246e58338fe9e8 (diff)
downloadexchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.tar.gz
exchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.tar.bz2
exchange-a166ca7fece8bbe3c66dcf0217cc81d20d185ab0.zip
fix #5281 for exchange: do preflight check that an old transaction is no longer running by accident
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-auditor.c11
-rw-r--r--src/auditor/taler-wire-auditor.c5
2 files changed, 11 insertions, 5 deletions
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index e807378fe..b8f6c624c 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -1890,7 +1890,7 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Detected applicable deposit of %s\n",
TALER_amount2s (&amount_without_fee));
- deposit_fee = fee;
+ deposit_fee = fee;
}
/* Check that the fees given in the transaction list and in dki match */
TALER_amount_ntoh (&tmp,
@@ -2006,7 +2006,7 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
merchant_gain,
deposit_fee));
}
-
+
/* Calculate total balance change, i.e. expenditures minus refunds */
if (GNUNET_SYSERR ==
TALER_amount_subtract (&spent,
@@ -3906,8 +3906,11 @@ transact (Analysis analysis,
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ edb->preflight (edb->cls,
+ esession);
ret = edb->start (edb->cls,
- esession);
+ esession,
+ "auditor");
if (GNUNET_OK != ret)
{
GNUNET_break (0);
@@ -3918,7 +3921,7 @@ transact (Analysis analysis,
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs)
{
qs = edb->commit (edb->cls,
- esession);
+ esession);
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
diff --git a/src/auditor/taler-wire-auditor.c b/src/auditor/taler-wire-auditor.c
index 8ba38d39c..55a2a05fb 100644
--- a/src/auditor/taler-wire-auditor.c
+++ b/src/auditor/taler-wire-auditor.c
@@ -1412,8 +1412,11 @@ run (void *cls,
GNUNET_SCHEDULER_shutdown ();
return;
}
+ edb->preflight (edb->cls,
+ esession);
ret = edb->start (edb->cls,
- esession);
+ esession,
+ "wire auditor");
if (GNUNET_OK != ret)
{
GNUNET_break (0);