diff options
Diffstat (limited to 'src/backend/taler-merchant-exchange.c')
-rw-r--r-- | src/backend/taler-merchant-exchange.c | 26 |
1 files changed, 20 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` */ |