aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-08-23 09:17:57 +0200
committerChristian Grothoff <christian@grothoff.org>2024-08-23 09:17:57 +0200
commit5fcddeed9bef716475a7b46a4a6180f32812ca14 (patch)
tree3cd7c16bfba604b3b4ed402bca30d72690b6ffb5
parent7bf67326d250e2a7d63d129f7d7210d5f50324a1 (diff)
fix wire-credit
-rw-r--r--src/auditor/taler-helper-auditor-wire-credit.c8
-rw-r--r--src/auditordb/0002-auditor_reserve_in_inconsistency.sql13
-rw-r--r--src/auditordb/pg_insert_reserve_in_inconsistency.c12
-rw-r--r--src/include/taler_auditordb_plugin.h2
4 files changed, 19 insertions, 16 deletions
diff --git a/src/auditor/taler-helper-auditor-wire-credit.c b/src/auditor/taler-helper-auditor-wire-credit.c
index 2a68326b7..3f19de9a3 100644
--- a/src/auditor/taler-helper-auditor-wire-credit.c
+++ b/src/auditor/taler-helper-auditor-wire-credit.c
@@ -409,6 +409,8 @@ commit (enum GNUNET_DB_QueryStatus qs)
TALER_ARL_adb->rollback (TALER_ARL_adb->cls);
TALER_ARL_edb->rollback (TALER_ARL_edb->cls);
}
+ if (1 == test_mode)
+ GNUNET_SCHEDULER_shutdown ();
}
@@ -525,7 +527,7 @@ complain_in_not_found (void *cls,
struct ReserveInInfo *rii = value;
enum GNUNET_DB_QueryStatus qs;
struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
- .row_id = rii->rowid,
+ .bank_row_id = rii->rowid,
.diagnostic = "incoming wire transfer claimed by exchange not found",
.account = (char *) wa->ai->section_name,
.amount_exchange_expected = rii->credit_details.amount,
@@ -639,7 +641,7 @@ analyze_credit (
struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
.diagnostic = "wire subject does not match",
.account = (char *) wa->ai->section_name,
- .row_id = credit_details->serial_id, // FIXME: correct row?
+ .bank_row_id = credit_details->serial_id,
.amount_exchange_expected = rii->credit_details.amount,
.amount_wired = zero,
.reserve_pub = rii->credit_details.details.reserve.reserve_pub,
@@ -674,7 +676,7 @@ analyze_credit (
struct TALER_AUDITORDB_ReserveInInconsistency riiDb = {
.diagnostic = "wire amount does not match",
.account = (char *) wa->ai->section_name,
- .row_id = credit_details->serial_id, // FIXME: correct row?
+ .bank_row_id = credit_details->serial_id,
.amount_exchange_expected = rii->credit_details.amount,
.amount_wired = credit_details->amount,
.reserve_pub = rii->credit_details.details.reserve.reserve_pub,
diff --git a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
index e2e8aed05..088aab597 100644
--- a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
+++ b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql
@@ -18,12 +18,13 @@ SET search_path TO auditor;
CREATE TABLE IF NOT EXISTS auditor_reserve_in_inconsistency
(
row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY,
- amount_exchange_expected taler_amount,
- amount_wired taler_amount,
- reserve_pub BYTEA,
- timestamp BIGINT,
- account BYTEA,
- diagnostic BYTEA,
+ bank_row_id INT8 NOT NULL,
+ amount_exchange_expected taler_amount NOT NULL,
+ amount_wired taler_amount NOT NULL,
+ reserve_pub BYTEA NOT NULL,
+ timestamp BIGINT NOT NULL,
+ account BYTEA NOT NULL,
+ diagnostic BYTEA NOT NULL,
suppressed BOOLEAN NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE auditor_reserve_in_inconsistency
diff --git a/src/auditordb/pg_insert_reserve_in_inconsistency.c b/src/auditordb/pg_insert_reserve_in_inconsistency.c
index 9c98b7ace..f92249049 100644
--- a/src/auditordb/pg_insert_reserve_in_inconsistency.c
+++ b/src/auditordb/pg_insert_reserve_in_inconsistency.c
@@ -28,22 +28,22 @@ TAH_PG_insert_reserve_in_inconsistency (
{
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
-
- TALER_PQ_query_param_amount (pg->conn, &dc->amount_exchange_expected),
- TALER_PQ_query_param_amount (pg->conn, &dc->amount_wired),
+ GNUNET_PQ_query_param_uint64 (&dc->bank_row_id),
+ TALER_PQ_query_param_amount (pg->conn,
+ &dc->amount_exchange_expected),
+ TALER_PQ_query_param_amount (pg->conn,
+ &dc->amount_wired),
GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub),
GNUNET_PQ_query_param_absolute_time (&dc->timestamp),
GNUNET_PQ_query_param_auto_from_type (&dc->account),
GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic),
-
-
GNUNET_PQ_query_param_end
};
PREPARE (pg,
"auditor_reserve_in_inconsistency_insert",
"INSERT INTO auditor_reserve_in_inconsistency "
- "( row_id,"
+ "(bank_row_id,"
" amount_exchange_expected,"
" amount_wired,"
" reserve_pub,"
diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h
index 3a5ef2210..430fad9d0 100644
--- a/src/include/taler_auditordb_plugin.h
+++ b/src/include/taler_auditordb_plugin.h
@@ -369,7 +369,7 @@ struct TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency
*/
struct TALER_AUDITORDB_ReserveInInconsistency
{
- uint64_t row_id;
+ uint64_t bank_row_id;
struct TALER_Amount amount_exchange_expected;
struct TALER_Amount amount_wired;
struct TALER_ReservePublicKeyP reserve_pub;