summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-07-01 15:55:29 +0200
committerChristian Grothoff <christian@grothoff.org>2017-07-01 15:55:29 +0200
commitd85a8566f3339f271e65caead9c68bd8d648d2b4 (patch)
tree5a546175495767cc141b3b904245e5a202c67ab5 /src/backend
parentaa83a9187873339c97177da77f9cd84f30f678f0 (diff)
downloadmerchant-d85a8566f3339f271e65caead9c68bd8d648d2b4.tar.gz
merchant-d85a8566f3339f271e65caead9c68bd8d648d2b4.tar.bz2
merchant-d85a8566f3339f271e65caead9c68bd8d648d2b4.zip
implement first part of #4943: persist wire transfer fees of exchange in DB
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c
index a0d32024..a011be43 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -341,15 +341,36 @@ process_wire_fees (void *cls,
}
while (NULL != fees)
{
+ struct GNUNET_HashCode h_wire_method;
+ enum GNUNET_DB_QueryStatus qs;
+
af = GNUNET_new (struct TALER_EXCHANGE_WireAggregateFees);
*af = *fees;
+ GNUNET_CRYPTO_hash (wire_method,
+ strlen (wire_method) + 1,
+ &h_wire_method);
+ qs = db->store_wire_fee_by_exchange (db->cls,
+ &exchange->master_pub,
+ &h_wire_method,
+ &af->wire_fee,
+ &af->closing_fee,
+ af->start_date,
+ af->end_date,
+ &af->master_sig);
+ if (0 > qs)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to persist exchange wire fees in merchant DB!\n");
+ GNUNET_free (af);
+ fees = fees->next;
+ continue;
+ }
af->next = NULL;
if (NULL == endp)
f->af = af;
else
endp->next = af;
endp = af;
- // FIXME #4943: also preserve `fees` in backend DB (under wire method + exchange master pub!)
fees = fees->next;
}
}