aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-27 14:34:44 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-03-27 14:34:44 +0200
commit1f1d675f3dff18f3779d4d01cdb2b69da9e2fd8b (patch)
tree9d3796b32d4afb6ead29c5f7e6593c41ae904d29 /src/exchangedb
parentb9a9af3a59f3abdb09afb9d0f9e4c0d83df789b7 (diff)
downloadexchange-1f1d675f3dff18f3779d4d01cdb2b69da9e2fd8b.tar.xz
-remove tiny field, no longer needed
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/exchange-0001.sql39
-rw-r--r--src/exchangedb/irbt_callbacks.c1
-rw-r--r--src/exchangedb/lrbt_callbacks.c3
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c286
-rw-r--r--src/exchangedb/test_exchangedb.c99
5 files changed, 29 insertions, 399 deletions
diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql
index e6902ed1c..2955663ac 100644
--- a/src/exchangedb/exchange-0001.sql
+++ b/src/exchangedb/exchange-0001.sql
@@ -699,7 +699,6 @@ CREATE TABLE IF NOT EXISTS deposits
,coin_sig BYTEA NOT NULL CHECK (LENGTH(coin_sig)=64)
,wire_salt BYTEA NOT NULL CHECK (LENGTH(wire_salt)=16)
,wire_target_h_payto BYTEA CHECK (LENGTH(wire_target_h_payto)=32)
- ,tiny BOOLEAN NOT NULL DEFAULT FALSE
,done BOOLEAN NOT NULL DEFAULT FALSE
,extension_blocked BOOLEAN NOT NULL DEFAULT FALSE
,extension_details_serial_id INT8 REFERENCES extension_details (extension_details_serial_id) ON DELETE CASCADE
@@ -722,8 +721,6 @@ COMMENT ON COLUMN deposits.extension_blocked
IS 'True if the aggregation of the deposit is currently blocked by some extension mechanism. Used to filter out deposits that must not be processed by the canonical deposit logic.';
COMMENT ON COLUMN deposits.extension_details_serial_id
IS 'References extensions table, NULL if extensions are not used';
-COMMENT ON COLUMN deposits.tiny
- IS 'Set to TRUE if we decided that the amount is too small to ever trigger a wire transfer by itself (requires real aggregation)';
CREATE INDEX IF NOT EXISTS deposits_by_coin_pub_index
ON deposits
@@ -795,11 +792,8 @@ CREATE OR REPLACE FUNCTION deposits_insert_trigger()
AS $$
DECLARE
is_ready BOOLEAN;
-DECLARE
- is_tready BOOLEAN; -- is ready, but may be tiny
BEGIN
- is_ready = NOT (NEW.done OR NEW.tiny OR NEW.extension_blocked);
- is_tready = NOT (NEW.done OR NEW.extension_blocked);
+ is_ready = NOT (NEW.done OR NEW.extension_blocked);
IF (is_ready)
THEN
@@ -813,9 +807,6 @@ BEGIN
,NEW.shard
,NEW.coin_pub
,NEW.deposit_serial_id);
- END IF;
- IF (is_tready)
- THEN
INSERT INTO deposits_for_matching
(refund_deadline
,merchant_pub
@@ -845,15 +836,9 @@ DECLARE
was_ready BOOLEAN;
DECLARE
is_ready BOOLEAN;
-DECLARE
- was_tready BOOLEAN; -- was ready, but may be tiny
-DECLARE
- is_tready BOOLEAN; -- is ready, but may be tiny
BEGIN
- was_ready = NOT (OLD.done OR OLD.tiny OR OLD.extension_blocked);
- is_ready = NOT (NEW.done OR NEW.tiny OR NEW.extension_blocked);
- was_tready = NOT (OLD.done OR OLD.extension_blocked);
- is_tready = NOT (NEW.done OR NEW.extension_blocked);
+ was_ready = NOT (OLD.done OR OLD.extension_blocked);
+ is_ready = NOT (NEW.done OR NEW.extension_blocked);
IF (was_ready AND NOT is_ready)
THEN
DELETE FROM deposits_by_ready
@@ -861,9 +846,6 @@ BEGIN
AND shard = OLD.shard
AND coin_pub = OLD.coin_pub
AND deposit_serial_id = OLD.deposit_serial_id;
- END IF;
- IF (was_tready AND NOT is_tready)
- THEN
DELETE FROM deposits_for_matching
WHERE refund_deadline = OLD.refund_deadline
AND merchant_pub = OLD.merchant_pub
@@ -882,9 +864,6 @@ BEGIN
,NEW.shard
,NEW.coin_pub
,NEW.deposit_serial_id);
- END IF;
- IF (is_tready AND NOT was_tready)
- THEN
INSERT INTO deposits_for_matching
(refund_deadline
,merchant_pub
@@ -912,11 +891,8 @@ CREATE OR REPLACE FUNCTION deposits_delete_trigger()
AS $$
DECLARE
was_ready BOOLEAN;
-DECLARE
- was_tready BOOLEAN; -- is ready, but may be tiny
BEGIN
- was_ready = NOT (OLD.done OR OLD.tiny OR OLD.extension_blocked);
- was_tready = NOT (OLD.done OR OLD.extension_blocked);
+ was_ready = NOT (OLD.done OR OLD.extension_blocked);
IF (was_ready)
THEN
@@ -925,9 +901,6 @@ BEGIN
AND shard = OLD.shard
AND coin_pub = OLD.coin_pub
AND deposit_serial_id = OLD.deposit_serial_id;
- END IF;
- IF (was_tready)
- THEN
DELETE FROM deposits_for_matching
WHERE refund_deadline = OLD.refund_deadline
AND merchant_pub = OLD.merchant_pub
@@ -1061,10 +1034,6 @@ CREATE TRIGGER wire_out_on_delete
-- ------------------------------ aggregation_transient ----------------------------------------
--- Note: this table is not yet used; it is designed
--- to allow us to get rid of the 'tiny BOOL' and
--- the associated need to look at tiny
--- deposits repeatedly.
CREATE TABLE IF NOT EXISTS aggregation_transient
(amount_val INT8 NOT NULL
,amount_frac INT4 NOT NULL
diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index 835c0ea77..172dfcbeb 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -526,7 +526,6 @@ irbt_cb_table_deposits (struct PostgresClosure *pg,
GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.wire_salt),
GNUNET_PQ_query_param_auto_from_type (
&td->details.deposits.wire_target_h_payto),
- GNUNET_PQ_query_param_bool (td->details.deposits.tiny),
GNUNET_PQ_query_param_bool (td->details.deposits.done),
GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked),
0 == td->details.deposits.extension_details_serial_id
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c
index 0fec486ec..5451be761 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -954,9 +954,6 @@ lrbt_cb_table_deposits (void *cls,
"wire_target_h_payto",
&td.details.deposits.wire_target_h_payto),
GNUNET_PQ_result_spec_bool (
- "tiny",
- &td.details.deposits.tiny),
- GNUNET_PQ_result_spec_bool (
"done",
&td.details.deposits.done),
GNUNET_PQ_result_spec_auto_from_type (
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 36a5e48b2..a157c64f2 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -1176,33 +1176,6 @@ prepare_statements (struct PostgresClosure *pg)
" ,dbr.shard ASC"
" LIMIT 1;",
4),
- /* FIXME: deprecated; Used in #postgres_iterate_matching_deposits() */
- GNUNET_PQ_make_prepare (
- "deposits_iterate_matching",
- "SELECT"
- " dep.deposit_serial_id"
- ",dep.amount_with_fee_val"
- ",dep.amount_with_fee_frac"
- ",denom.fee_deposit_val"
- ",denom.fee_deposit_frac"
- ",dep.h_contract_terms"
- ",dfm.coin_pub"
- " FROM deposits_for_matching dfm"
- " JOIN deposits dep "
- " ON (dep.coin_pub = dfm.coin_pub and dep.deposit_serial_id = dfm.deposit_serial_id)"
- " JOIN known_coins kc"
- " ON (dep.coin_pub = kc.coin_pub)"
- " JOIN denominations denom"
- " USING (denominations_serial)"
- " WHERE dfm.refund_deadline<$3"
- " AND dfm.merchant_pub=$1"
- " AND dep.merchant_pub=$1"
- " AND dep.wire_target_h_payto=$2"
- " LIMIT "
- TALER_QUOTE (
- TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT) ";",
- 3),
-
/* Used in #postgres_aggregate() */
GNUNET_PQ_make_prepare (
"aggregate",
@@ -1311,24 +1284,6 @@ prepare_statements (struct PostgresClosure *pg)
" AND wtid_raw=$2",
2),
-
- /* FIXME-deprecated: Used in #postgres_mark_deposit_tiny() */
- GNUNET_PQ_make_prepare (
- "mark_deposit_tiny",
- "UPDATE deposits"
- " SET tiny=TRUE"
- " WHERE coin_pub=$1"
- " AND deposit_serial_id=$2",
- 2),
- /* FIXME-deprecated: Used in #postgres_mark_deposit_done() */
- GNUNET_PQ_make_prepare (
- "mark_deposit_done",
- "UPDATE deposits"
- " SET done=TRUE"
- " WHERE coin_pub=$1"
- " AND deposit_serial_id=$2;",
- 2),
-
/* Used in #postgres_get_coin_transactions() to obtain information
about how a coin has been spend with /deposit requests. */
GNUNET_PQ_make_prepare (
@@ -1614,7 +1569,7 @@ prepare_statements (struct PostgresClosure *pg)
2),
/* Used in #postgres_select_deposits_missing_wire */
// FIXME: used by the auditor; can probably be done
- // smarter by checking if 'done' or 'tiny' or 'blocked'
+ // smarter by checking if 'done' or 'blocked'
// are set correctly when going over deposits, instead
// of JOINing with refunds.
GNUNET_PQ_make_prepare (
@@ -1626,7 +1581,6 @@ prepare_statements (struct PostgresClosure *pg)
",amount_with_fee_frac"
",payto_uri"
",wire_deadline"
- ",tiny"
",done"
" FROM deposits d"
" JOIN known_coins"
@@ -2590,7 +2544,6 @@ prepare_statements (struct PostgresClosure *pg)
",coin_sig"
",wire_salt"
",wire_target_h_payto"
- ",tiny"
",done"
",extension_blocked"
",extension_details_serial_id"
@@ -2923,14 +2876,13 @@ prepare_statements (struct PostgresClosure *pg)
",coin_sig"
",wire_salt"
",wire_target_h_payto"
- ",tiny"
",done"
",extension_blocked"
",extension_details_serial_id"
") VALUES "
"($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,"
- " $11, $12, $13, $14, $15, $16, $17, $18, $19);",
- 19),
+ " $11, $12, $13, $14, $15, $16, $17, $18);",
+ 18),
GNUNET_PQ_make_prepare (
"insert_into_table_refunds",
"INSERT INTO refunds"
@@ -6202,64 +6154,8 @@ postgres_delete_aggregation_transient (
/**
- * Mark a deposit as tiny, thereby declaring that it cannot be
- * executed by itself and should no longer be returned by
- * @e iterate_ready_deposits()
- *
- * @param cls the @e cls of this struct with the plugin-specific state
- * @param merchant_pub identifies the beneficiary of the deposit
- * @param rowid identifies the deposit row to modify
- * @return query result status
- */
-static enum GNUNET_DB_QueryStatus
-postgres_mark_deposit_tiny (void *cls,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- uint64_t rowid)
-{
- struct PostgresClosure *pg = cls;
- struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_auto_from_type (coin_pub),
- GNUNET_PQ_query_param_uint64 (&rowid),
- GNUNET_PQ_query_param_end
- };
-
- return GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "mark_deposit_tiny",
- params);
-}
-
-
-/**
- * Mark a deposit as done, thereby declaring that it cannot be
- * executed at all anymore, and should no longer be returned by
- * @e iterate_ready_deposits() or @e iterate_matching_deposits().
- *
- * @param cls the @e cls of this struct with the plugin-specific state
- * @param merchant_pub identifies the beneficiary of the deposit
- * @param rowid identifies the deposit row to modify
- * @return query result status
- */
-static enum GNUNET_DB_QueryStatus
-postgres_mark_deposit_done (void *cls,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- uint64_t rowid)
-{
- struct PostgresClosure *pg = cls;
- struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_auto_from_type (coin_pub),
- GNUNET_PQ_query_param_uint64 (&rowid),
- GNUNET_PQ_query_param_end
- };
-
- return GNUNET_PQ_eval_prepared_non_select (pg->conn,
- "mark_deposit_done",
- params);
-}
-
-
-/**
* Obtain information about deposits that are ready to be executed. Such
- * deposits must not be marked as "tiny" or "done", the execution time must be
+ * deposits must not be marked as "done", the execution time must be
* in the past, and the KYC status must be 'ok'.
*
* @param cls the @e cls of this struct with the plugin-specific state
@@ -6312,173 +6208,6 @@ postgres_get_ready_deposit (void *cls,
/**
- * Closure for #match_deposit_cb().
- */
-struct MatchingDepositContext
-{
- /**
- * Function to call for each result
- */
- TALER_EXCHANGEDB_MatchingDepositIterator deposit_cb;
-
- /**
- * Closure for @e deposit_cb.
- */
- void *deposit_cb_cls;
-
- /**
- * Public key of the merchant against which we are matching.
- */
- const struct TALER_MerchantPublicKeyP *merchant_pub;
-
- /**
- * Plugin context.
- */
- struct PostgresClosure *pg;
-
- /**
- * Maximum number of results to return.
- */
- uint32_t limit;
-
- /**
- * Loop counter, actual number of results returned.
- */
- unsigned int i;
-
- /**
- * Set to #GNUNET_SYSERR on hard errors.
- */
- enum GNUNET_GenericReturnValue status;
-};
-
-
-/**
- * Helper function for #postgres_iterate_matching_deposits().
- * To be called with the results of a SELECT statement
- * that has returned @a num_results results.
- *
- * @param cls closure of type `struct MatchingDepositContext *`
- * @param result the postgres result
- * @param num_results the number of results in @a result
- */
-static void
-match_deposit_cb (void *cls,
- PGresult *result,
- unsigned int num_results)
-{
- struct MatchingDepositContext *mdc = cls;
- struct PostgresClosure *pg = mdc->pg;
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Found %u/%u matching deposits\n",
- num_results,
- mdc->limit);
- num_results = GNUNET_MIN (num_results,
- mdc->limit);
- for (mdc->i = 0; mdc->i<num_results; mdc->i++)
- {
- struct TALER_Amount amount_with_fee;
- struct TALER_Amount deposit_fee;
- struct TALER_PrivateContractHashP h_contract_terms;
- struct TALER_CoinSpendPublicKeyP coin_pub;
- uint64_t serial_id;
- enum GNUNET_DB_QueryStatus qs;
- struct GNUNET_PQ_ResultSpec rs[] = {
- GNUNET_PQ_result_spec_uint64 ("deposit_serial_id",
- &serial_id),
- TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee",
- &amount_with_fee),
- TALER_PQ_RESULT_SPEC_AMOUNT ("fee_deposit",
- &deposit_fee),
- GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
- &h_contract_terms),
- GNUNET_PQ_result_spec_auto_from_type ("coin_pub",
- &coin_pub),
- GNUNET_PQ_result_spec_end
- };
-
- if (GNUNET_OK !=
- GNUNET_PQ_extract_result (result,
- rs,
- mdc->i))
- {
- GNUNET_break (0);
- mdc->status = GNUNET_SYSERR;
- return;
- }
- qs = mdc->deposit_cb (mdc->deposit_cb_cls,
- serial_id,
- &coin_pub,
- &amount_with_fee,
- &deposit_fee,
- &h_contract_terms);
- GNUNET_PQ_cleanup_result (rs);
- if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
- break;
- }
-}
-
-
-/**
- * Obtain information about other pending deposits for the same
- * destination. Those deposits must not already be "done".
- *
- * @param cls the @e cls of this struct with the plugin-specific state
- * @param h_payto destination of the wire transfer
- * @param merchant_pub public key of the merchant
- * @param deposit_cb function to call for each deposit
- * @param deposit_cb_cls closure for @a deposit_cb
- * @param limit maximum number of matching deposits to return
- * @return transaction status code, if positive:
- * number of rows processed, 0 if none exist
- */
-static enum GNUNET_DB_QueryStatus
-postgres_iterate_matching_deposits (
- void *cls,
- const struct TALER_PaytoHashP *h_payto,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- TALER_EXCHANGEDB_MatchingDepositIterator deposit_cb,
- void *deposit_cb_cls,
- uint32_t limit)
-{
- struct PostgresClosure *pg = cls;
- struct GNUNET_TIME_Absolute now = {0};
- struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_auto_from_type (merchant_pub),
- GNUNET_PQ_query_param_auto_from_type (h_payto),
- GNUNET_PQ_query_param_absolute_time (&now),
- GNUNET_PQ_query_param_end
- };
- struct MatchingDepositContext mdc = {
- .deposit_cb = deposit_cb,
- .deposit_cb_cls = deposit_cb_cls,
- .merchant_pub = merchant_pub,
- .pg = pg,
- .limit = limit,
- .status = GNUNET_OK
- };
- enum GNUNET_DB_QueryStatus qs;
-
- now = GNUNET_TIME_absolute_round_down (GNUNET_TIME_absolute_get (),
- pg->aggregator_shift);
- qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
- "deposits_iterate_matching",
- params,
- &match_deposit_cb,
- &mdc);
- if (GNUNET_OK != mdc.status)
- {
- GNUNET_break (0);
- return GNUNET_DB_STATUS_HARD_ERROR;
- }
- if (qs >= 0)
- return mdc.i;
- return qs;
-}
-
-
-/**
* Retrieve the record for a known coin.
*
* @param cls the plugin closure
@@ -10806,7 +10535,6 @@ missing_wire_cb (void *cls,
struct TALER_Amount amount;
char *payto_uri;
struct GNUNET_TIME_Timestamp deadline;
- bool tiny;
bool done;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint64 ("deposit_serial_id",
@@ -10819,8 +10547,6 @@ missing_wire_cb (void *cls,
&payto_uri),
GNUNET_PQ_result_spec_timestamp ("wire_deadline",
&deadline),
- GNUNET_PQ_result_spec_bool ("tiny",
- &tiny),
GNUNET_PQ_result_spec_bool ("done",
&done),
GNUNET_PQ_result_spec_end
@@ -10841,7 +10567,6 @@ missing_wire_cb (void *cls,
&amount,
payto_uri,
deadline,
- tiny,
done);
GNUNET_PQ_cleanup_result (rs);
}
@@ -13384,10 +13109,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
= &postgres_update_aggregation_transient;
plugin->delete_aggregation_transient
= &postgres_delete_aggregation_transient;
- plugin->mark_deposit_tiny = &postgres_mark_deposit_tiny;
- plugin->mark_deposit_done = &postgres_mark_deposit_done;
plugin->get_ready_deposit = &postgres_get_ready_deposit;
- plugin->iterate_matching_deposits = &postgres_iterate_matching_deposits;
plugin->insert_deposit = &postgres_insert_deposit;
plugin->insert_refund = &postgres_insert_refund;
plugin->select_refunds_by_coin = &postgres_select_refunds_by_coin;
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 9e2e8a480..9369bacbe 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -607,72 +607,10 @@ cb_wt_check (void *cls,
/**
- * Here #deposit_cb() will store the row ID of the deposit.
- */
-static uint64_t deposit_rowid;
-
-/**
- * Here #deposit_cb() will store the row ID of the account.
- */
-static uint64_t wire_target_row;
-
-/**
- * Here #deposit_cb() will store the hash of the payto URI.
+ * Here we store the hash of the payto URI.
*/
static struct TALER_PaytoHashP wire_target_h_payto;
-/**
- * Function called with details about deposits that
- * have been made. Called in the test on the
- * deposit given in @a cls.
- *
- * @param cls closure a `struct TALER_EXCHANGEDB_Deposit *`
- * @param rowid unique ID for the deposit in our DB, used for marking
- * it as 'tiny' or 'done'
- * @param merchant_pub public key of the merchant
- * @param coin_pub public key of the coin
- * @param amount_with_fee amount that was deposited including fee
- * @param deposit_fee amount the exchange gets to keep as transaction fees
- * @param h_contract_terms hash of the proposal data known to merchant and customer
- * @param wire_target unique ID of the receiver account
- * @param payto_uri how to pay the merchant, URI in payto://-format;
- * @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate
- */
-static enum GNUNET_DB_QueryStatus
-deposit_cb (void *cls,
- uint64_t rowid,
- const struct TALER_MerchantPublicKeyP *merchant_pub,
- const struct TALER_CoinSpendPublicKeyP *coin_pub,
- const struct TALER_Amount *amount_with_fee,
- const struct TALER_Amount *deposit_fee,
- const struct TALER_PrivateContractHashP *h_contract_terms,
- uint64_t wire_target,
- const char *payto_uri)
-{
- struct TALER_EXCHANGEDB_Deposit *deposit = cls;
-
- if ( (0 == GNUNET_memcmp (merchant_pub,
- &deposit->merchant_pub)) &&
- (0 == TALER_amount_cmp (amount_with_fee,
- &deposit->amount_with_fee)) &&
- (0 == TALER_amount_cmp (deposit_fee,
- &deposit->deposit_fee)) &&
- (0 == GNUNET_memcmp (h_contract_terms,
- &deposit->h_contract_terms)) &&
- (0 == GNUNET_memcmp (coin_pub,
- &deposit->coin.coin_pub)) &&
- (0 == strcmp (payto_uri,
- deposit->receiver_wire_account)) )
- {
- deposit_rowid = rowid;
- wire_target_row = wire_target;
- TALER_payto_hash (payto_uri,
- &wire_target_h_payto);
- result = 9;
- }
- return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
-}
-
/**
* Callback for #select_deposits_above_serial_id ()
@@ -1191,7 +1129,6 @@ drop:
* @param amount value of the deposit, including fee
* @param payto_uri where should the funds be wired
* @param deadline what was the requested wire transfer deadline
- * @param tiny did the exchange defer this transfer because it is too small?
* @param done did the exchange claim that it made a transfer?
*/
static void
@@ -1201,7 +1138,6 @@ wire_missing_cb (void *cls,
const struct TALER_Amount *amount,
const char *payto_uri,
struct GNUNET_TIME_Timestamp deadline,
- bool tiny,
bool done)
{
const struct TALER_EXCHANGEDB_Deposit *deposit = cls;
@@ -1209,11 +1145,6 @@ wire_missing_cb (void *cls,
(void) payto_uri;
(void) deadline;
(void) rowid;
- if (tiny)
- {
- GNUNET_break (0);
- result = 66;
- }
if (done)
{
GNUNET_break (0);
@@ -2212,14 +2143,26 @@ run (void *cls)
FAILIF (0 == auditor_row_cnt);
result = 8;
sleep (2); /* give deposit time to be ready */
- FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
- plugin->get_ready_deposit (plugin->cls,
- 0,
- INT32_MAX,
- true,
- &deposit_cb,
- &deposit));
- FAILIF (8 == result);
+ {
+ struct TALER_MerchantPublicKeyP merchant_pub2;
+ char *payto_uri2;
+
+ FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
+ plugin->get_ready_deposit (plugin->cls,
+ 0,
+ INT32_MAX,
+ true,
+ &merchant_pub2,
+ &payto_uri2));
+ FAILIF (0 != GNUNET_memcmp (&merchant_pub2,
+ &deposit.merchant_pub));
+ FAILIF (0 != strcmp (payto_uri2,
+ deposit.receiver_wire_account));
+ TALER_payto_hash (payto_uri2,
+ &wire_target_h_payto);
+ GNUNET_free (payto_uri2);
+ }
+
{
struct TALER_Amount total;
struct TALER_WireTransferIdentifierRawP wtid;