commit 7f3f96f9f2e3d5b1e5081dc91adc2b27f85ff2f1
parent 99fa42a9abe0d82d596fb8d3ed40844f4af82439
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 27 May 2025 12:25:23 +0200
comment out auditor code releated to recoup and mark it for #9828
Diffstat:
3 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
@@ -2195,17 +2195,20 @@ recoup_cb (void *cls,
}
+#if FIXME_9828
/**
- * Function called about recoups on refreshed coins the exchange has to
- * perform.
+ * Function called about recoups on refreshed coins the exchange had to
+ * perform. Updates the denomination balance(s). Does not change the
+ * coin balances, as those are already updated when we check the coin
+ * history.
*
* @param cls a `struct CoinContext *`
* @param rowid row identifier used to uniquely identify the recoup operation
* @param timestamp when did we receive the recoup request
- * @param amount how much should be added back to the reserve
+ * @param amount how much should be added back to the old coin
* @param old_coin_pub original coin that was refreshed to create @a coin
* @param old_denom_pub_hash hash of the public key of @a old_coin_pub
- * @param coin public information about the coin
+ * @param coin public information about the fresh coin
* @param denom_pub denomination public key of @a coin
* @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP
* @param coin_blind blinding factor used to blind the coin
@@ -2324,6 +2327,9 @@ recoup_refresh_cb (void *cls,
}
+#endif
+
+
/**
* Function called with the results of iterate_denomination_info(),
* or directly (!). Used to check that we correctly signed the
@@ -2659,6 +2665,7 @@ analyze_coins (void *cls)
qs = cc.qs;
goto cleanup;
}
+#if FIXME_9828
/* process recoups */
if (0 >
(qs = TALER_ARL_edb->select_recoup_refresh_above_serial_id (
@@ -2675,6 +2682,7 @@ analyze_coins (void *cls)
qs = cc.qs;
goto cleanup;
}
+#endif
/* process deposits */
if (0 >
(qs = TALER_ARL_edb->select_coin_deposits_above_serial_id (
diff --git a/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c b/src/exchangedb/pg_select_recoup_refresh_above_serial_id.c
@@ -162,41 +162,46 @@ TEH_PG_select_recoup_refresh_above_serial_id (
enum GNUNET_DB_QueryStatus qs;
PREPARE (pg,
- "recoup_refresh_get_incr",
+ "select_recoup_refresh_above_serial_id",
"SELECT"
- " recoup_refresh_uuid"
- ",recoup_timestamp"
- ",old_coins.coin_pub AS old_coin_pub"
+ " rr.recoup_refresh_uuid"
+ ",rr.recoup_timestamp"
+ ",rr.coin_sig"
+ ",rr.coin_blind"
+ ",rr.amount"
+ ",rrc.h_coin_ev AS h_blind_ev" // FIXME:-#9828 r.rc? r.selected_h? Old logic wanted a TALER_BlindedCoinHash, which we now need to derive (from rr.coin_blind)
",new_coins.age_commitment_hash"
- ",old_denoms.denom_pub_hash AS old_denom_pub_hash"
- ",new_coins.coin_pub As coin_pub"
- ",coin_sig"
- ",coin_blind"
+ ",new_coins.coin_pub AS coin_pub"
",new_denoms.denom_pub AS denom_pub"
- ",rrc.h_coin_ev AS h_blind_ev"
",new_denoms.denom_pub_hash"
",new_coins.denom_sig AS denom_sig"
- ",amount"
- " FROM recoup_refresh"
- " INNER JOIN refresh_revealed_coins rrc"
- " USING (rrc_serial)"
- " INNER JOIN refresh_commitments rfc"
- " ON (rrc.melt_serial_id = rfc.melt_serial_id)"
- " INNER JOIN known_coins old_coins"
- " ON (rfc.old_coin_pub = old_coins.coin_pub)"
- " INNER JOIN known_coins new_coins"
- " ON (new_coins.coin_pub = recoup_refresh.coin_pub)"
- " INNER JOIN denominations new_denoms"
- " ON (new_coins.denominations_serial = new_denoms.denominations_serial)"
- " INNER JOIN denominations old_denoms"
- " ON (old_coins.denominations_serial = old_denoms.denominations_serial)"
+ ",old_coins.coin_pub AS old_coin_pub"
+ ",old_denoms.denom_pub_hash AS old_denom_pub_hash"
+ " FROM recoup_refresh rr"
+ " INNER JOIN refresh_revealed_coins rrc" // FIXME-#9828: no such table anymore!
+ // but we have 'refresh_id" which is an FK into 'refresh'!
+ " USING (rrc_serial)"
+ " INNER JOIN refresh r"
+ // but we have 'refresh_id" which is an FK into 'refresh'!
+ " USING (refresh_id)"
+ " INNER JOIN known_coins old_coins"
+ " ON (r.old_coin_pub = old_coins.coin_pub)"
+ " INNER JOIN known_coins new_coins"
+ " ON (rr.coin_pub == new_coins.coin_pub)"
+ " INNER JOIN refresh_commitments rfc"
+ " ON (rrc.melt_serial_id = rfc.melt_serial_id)"
+ " INNER JOIN denominations new_denoms"
+ " ON (new_coins.denominations_serial = new_denoms.denominations_serial)"
+ " INNER JOIN denominations old_denoms"
+ " ON (old_coins.denominations_serial = old_denoms.denominations_serial)"
" WHERE recoup_refresh_uuid>=$1"
" ORDER BY recoup_refresh_uuid ASC;");
- qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
- "recoup_refresh_get_incr",
- params,
- &recoup_refresh_serial_helper_cb,
- &psc);
+ qs = GNUNET_PQ_eval_prepared_multi_select (
+ pg->conn,
+ "select_recoup_refresh_above_serial_id",
+ params,
+ &recoup_refresh_serial_helper_cb,
+ &psc);
if (GNUNET_OK != psc.status)
return GNUNET_DB_STATUS_HARD_ERROR;
return qs;
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
@@ -3597,10 +3597,10 @@ typedef enum GNUNET_GenericReturnValue
* @param cls closure
* @param rowid row identifier used to uniquely identify the recoup operation
* @param timestamp when did we receive the recoup request
- * @param amount how much should be added back to the reserve
+ * @param amount how much should be added back to the old coin
* @param old_coin_pub original coin that was refreshed to create @a coin
* @param old_denom_pub_hash hash of public key of @a old_coin_pub
- * @param coin public information about the coin
+ * @param coin public information about the fresh coin
* @param denom_pub denomination key of @a coin
* @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP
* @param coin_blind blinding factor used to blind the coin