summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-04-01 21:11:21 +0200
committerChristian Grothoff <christian@grothoff.org>2024-04-01 21:11:21 +0200
commitfe9b3bc322ba5e92d3e08c04e103fc9acb92e888 (patch)
tree1f3b9d0099bb9ae283fc4690f34b6ceec4b8ecdb
parente6a4545620933a325b1e7e0d122c2281468bef62 (diff)
downloadmerchant-fe9b3bc322ba5e92d3e08c04e103fc9acb92e888.tar.gz
merchant-fe9b3bc322ba5e92d3e08c04e103fc9acb92e888.tar.bz2
merchant-fe9b3bc322ba5e92d3e08c04e103fc9acb92e888.zip
nicer logging
-rw-r--r--src/backend/taler-merchant-exchange.c26
-rw-r--r--src/backenddb/pg_lookup_deposits_by_contract_and_coin.c6
2 files changed, 26 insertions, 6 deletions
diff --git a/src/backend/taler-merchant-exchange.c b/src/backend/taler-merchant-exchange.c
index 80802956..7945cb50 100644
--- a/src/backend/taler-merchant-exchange.c
+++ b/src/backend/taler-merchant-exchange.c
@@ -727,8 +727,25 @@ check_transfer (void *cls,
TALER_amount_cmp_currency (amount_with_fee,
&ttd->coin_value)) ||
(0 != TALER_amount_cmp (amount_with_fee,
- &ttd->coin_value)) ||
- (GNUNET_OK !=
+ &ttd->coin_value)) )
+ {
+ /* Disagreement between the exchange and us about how much this
+ coin is worth! */
+ GNUNET_break_op (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Disagreement about coin value %s\n",
+ TALER_amount2s (amount_with_fee));
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Exchange gave it a value of %s\n",
+ TALER_amount2s (&ttd->coin_value));
+ ctc->check_transfer_result = GNUNET_SYSERR;
+ /* Build the `TrackTransferConflictDetails` */
+ ctc->ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_REPORTS;
+ ctc->failure = true;
+ /* FIXME: this should be reported to the auditor (once the auditor has an API for this) */
+ return;
+ }
+ if ( (GNUNET_OK !=
TALER_amount_cmp_currency (deposit_fee,
&ttd->coin_fee)) ||
(0 != TALER_amount_cmp (deposit_fee,
@@ -738,13 +755,10 @@ check_transfer (void *cls,
coin is worth! */
GNUNET_break_op (0);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Disagreement about coin value %s\n",
- TALER_amount2s (&ttd->coin_value));
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Expected fee is %s\n",
TALER_amount2s (&ttd->coin_fee));
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Fee of exchange is %s\n",
+ "Fee claimed by exchange is %s\n",
TALER_amount2s (deposit_fee));
ctc->check_transfer_result = GNUNET_SYSERR;
/* Build the `TrackTransferConflictDetails` */
diff --git a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
index 29ff3926..e585bd91 100644
--- a/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
+++ b/src/backenddb/pg_lookup_deposits_by_contract_and_coin.c
@@ -90,6 +90,9 @@ lookup_refunds_cb (void *cls,
ldcc->qs = GNUNET_DB_STATUS_HARD_ERROR;
return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Coin had refund of %s\n",
+ TALER_amount2s (&refund_amount));
if (0 == i)
ldcc->refund_total = refund_amount;
else
@@ -164,6 +167,9 @@ lookup_deposits_by_contract_and_coin_cb (void *cls,
}
if (TALER_amount_is_valid (&ldcc->refund_total))
{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Coin had total refunds of %s\n",
+ TALER_amount2s (&ldcc->refund_total));
if (1 ==
TALER_amount_cmp (&ldcc->refund_total,
&amount_with_fee))