merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 137aa249cac226a5f3c08bafbf2ad2659b7b86be
parent bf231732fd23ac0f1c385a6e8ef66db8bd13af11
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  6 Apr 2019 15:59:00 +0200

get rid of some memcmps

Diffstat:
Msrc/backend/taler-merchant-httpd_track-transaction.c | 32+++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_track-transaction.c b/src/backend/taler-merchant-httpd_track-transaction.c @@ -500,9 +500,8 @@ wire_deposits_cb (void *cls, for (unsigned int d=0;d<details_length;d++) { - if (0 == memcmp (&details[d].coin_pub, - &tcc->coin_pub, - sizeof (struct TALER_CoinSpendPublicKeyP))) + if (0 == GNUNET_memcmp (&details[d].coin_pub, + &tcc->coin_pub)) { tcc->wtid = tctx->current_wtid; tcc->execution_time = tctx->current_execution_time; @@ -713,9 +712,8 @@ generate_response (struct TrackTransactionContext *tctx) tcc2 != tcc; tcc2 = tcc2->next) { - if (0 == memcmp (&tcc->wtid, - &tcc2->wtid, - sizeof (struct TALER_WireTransferIdentifierRawP))) + if (0 == GNUNET_memcmp (&tcc->wtid, + &tcc2->wtid)) { found = GNUNET_YES; break; @@ -741,9 +739,8 @@ generate_response (struct TrackTransactionContext *tctx) tcc2 != tcc; tcc2 = tcc2->next) { - if (0 == memcmp (&tcc->wtid, - &tcc2->wtid, - sizeof (struct TALER_WireTransferIdentifierRawP))) + if (0 == GNUNET_memcmp (&tcc->wtid, + &tcc2->wtid)) { found = GNUNET_YES; break; @@ -764,9 +761,8 @@ generate_response (struct TrackTransactionContext *tctx) NULL != tcc2; tcc2 = tcc2->next) { - if (0 == memcmp (&wt->wtid, - &tcc2->wtid, - sizeof (struct TALER_WireTransferIdentifierRawP))) + if (0 == GNUNET_memcmp (&wt->wtid, + &tcc2->wtid)) num_coins++; } /* initialize coins array */ @@ -778,9 +774,8 @@ generate_response (struct TrackTransactionContext *tctx) NULL != tcc2; tcc2 = tcc2->next) { - if (0 == memcmp (&wt->wtid, - &tcc2->wtid, - sizeof (struct TALER_WireTransferIdentifierRawP))) + if (0 == GNUNET_memcmp (&wt->wtid, + &tcc2->wtid)) { struct TALER_MERCHANT_CoinWireTransfer *coin = &wt->coins[num_coins++]; @@ -939,9 +934,8 @@ transfer_cb (void *cls, { struct TrackCoinContext *tcc = cls; - if (0 != memcmp (coin_pub, - &tcc->coin_pub, - sizeof (struct TALER_CoinSpendPublicKeyP))) + if (0 != GNUNET_memcmp (coin_pub, + &tcc->coin_pub)) return; tcc->wtid = *wtid; tcc->execution_time = execution_time; @@ -1128,7 +1122,7 @@ MH_handler_track_transaction (struct TMH_RequestHandler *rh, return TMH_RESPONSE_reply_not_found (connection, TALER_EC_TRACK_TRANSACTION_INSTANCE_UNKNOWN, "unknown instance"); - + /* Map order id to contract terms; the objective is to get the contract term's hashcode so as to retrieve all the coins which have been deposited for it. */