summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-10-15 21:58:48 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-10-15 21:58:48 +0200
commitc72cf2ce10017dccc342c4ea86ac2b006aa54149 (patch)
treee1f9d17de5510e0f9681dde24d93b6947659dd43 /src
parent8afe2a17f05ce158f854d1be7af8ec058c0da08b (diff)
downloadexchange-c72cf2ce10017dccc342c4ea86ac2b006aa54149.tar.gz
exchange-c72cf2ce10017dccc342c4ea86ac2b006aa54149.tar.bz2
exchange-c72cf2ce10017dccc342c4ea86ac2b006aa54149.zip
-address FIXME
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_management_partners.c2
-rw-r--r--src/exchangedb/pg_aggregate.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_partners.c b/src/exchange/taler-exchange-httpd_management_partners.c
index c63192c60..e336d24ed 100644
--- a/src/exchange/taler-exchange-httpd_management_partners.c
+++ b/src/exchange/taler-exchange-httpd_management_partners.c
@@ -113,7 +113,7 @@ TEH_handler_management_partners (
}
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
- /* FIXME: check for idempotency! */
+ /* FIXME-#7271: check for idempotency! */
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_CONFLICT,
TALER_EC_EXCHANGE_MANAGEMENT_ADD_PARTNER_DATA_CONFLICT,
diff --git a/src/exchangedb/pg_aggregate.c b/src/exchangedb/pg_aggregate.c
index 6f143e940..16805d757 100644
--- a/src/exchangedb/pg_aggregate.c
+++ b/src/exchangedb/pg_aggregate.c
@@ -22,10 +22,12 @@
#include "taler_error_codes.h"
#include "taler_dbevents.h"
#include "taler_pq_lib.h"
+#include "pg_compute_shard.h"
#include "pg_event_notify.h"
#include "pg_aggregate.h"
#include "pg_helper.h"
+
enum GNUNET_DB_QueryStatus
TEH_PG_aggregate (
void *cls,
@@ -35,6 +37,7 @@ TEH_PG_aggregate (
struct TALER_Amount *total)
{
struct PostgresClosure *pg = cls;
+ uint64_t deposit_shard = TEH_PG_compute_shard (merchant_pub);
struct GNUNET_TIME_Absolute now = {0};
uint64_t sum_deposit_value;
uint64_t sum_deposit_frac;
@@ -57,7 +60,7 @@ TEH_PG_aggregate (
" SET done=TRUE"
" WHERE NOT (done OR policy_blocked)" /* only actually executable deposits */
" AND refund_deadline<$1"
- /* FIXME: maybe more efficient to add shard here, too? */
+ " AND shard=$5" /* only for efficiency, merchant_pub is what we really filter by */
" AND merchant_pub=$2" /* filter by target merchant */
" AND wire_target_h_payto=$3" /* merchant could have a 2nd bank account */
" RETURNING"
@@ -135,6 +138,7 @@ TEH_PG_aggregate (
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
GNUNET_PQ_query_param_auto_from_type (h_payto),
GNUNET_PQ_query_param_auto_from_type (wtid),
+ GNUNET_PQ_query_param_uint64 (&deposit_shard),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {