Compare commits
No commits in common. "8563dcc8452d243ec63f98f0b63b48aa82c050a3" and "402ca17600d57e2a3569771eb57881c42d5db0e4" have entirely different histories.
8563dcc845
...
402ca17600
@ -18,8 +18,6 @@ CREATE OR REPLACE FUNCTION exchange_do_reserve_purse(
|
|||||||
IN in_purse_pub BYTEA,
|
IN in_purse_pub BYTEA,
|
||||||
IN in_merge_sig BYTEA,
|
IN in_merge_sig BYTEA,
|
||||||
IN in_merge_timestamp INT8,
|
IN in_merge_timestamp INT8,
|
||||||
IN in_reserve_expiration INT8,
|
|
||||||
IN in_reserve_gc INT8,
|
|
||||||
IN in_reserve_sig BYTEA,
|
IN in_reserve_sig BYTEA,
|
||||||
IN in_reserve_quota BOOLEAN,
|
IN in_reserve_quota BOOLEAN,
|
||||||
IN in_purse_fee_val INT8,
|
IN in_purse_fee_val INT8,
|
||||||
@ -107,14 +105,6 @@ ELSE
|
|||||||
out_no_funds=TRUE;
|
out_no_funds=TRUE;
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
INSERT INTO exchange.reserves
|
|
||||||
(reserve_pub
|
|
||||||
,expiration_date
|
|
||||||
,gc_date)
|
|
||||||
VALUES
|
|
||||||
(in_reserve_pub
|
|
||||||
,in_reserve_expiration
|
|
||||||
,in_reserve_gc);
|
|
||||||
ELSE
|
ELSE
|
||||||
UPDATE exchange.reserves
|
UPDATE exchange.reserves
|
||||||
SET
|
SET
|
||||||
@ -159,7 +149,7 @@ INSERT INTO exchange.account_merges
|
|||||||
|
|
||||||
END $$;
|
END $$;
|
||||||
|
|
||||||
COMMENT ON FUNCTION exchange_do_reserve_purse(BYTEA, BYTEA, INT8, INT8, INT8, BYTEA, BOOLEAN, INT8, INT4, BYTEA, BYTEA)
|
COMMENT ON FUNCTION exchange_do_reserve_purse(BYTEA, BYTEA, INT8, BYTEA, BOOLEAN, INT8, INT4, BYTEA, BYTEA)
|
||||||
IS 'Create a purse for a reserve.';
|
IS 'Create a purse for a reserve.';
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,21 +57,10 @@ TEH_PG_do_reserve_purse (
|
|||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct TALER_Amount zero_fee;
|
struct TALER_Amount zero_fee;
|
||||||
struct TALER_PaytoHashP h_payto;
|
struct TALER_PaytoHashP h_payto;
|
||||||
struct GNUNET_TIME_Timestamp reserve_expiration
|
|
||||||
= GNUNET_TIME_absolute_to_timestamp (
|
|
||||||
GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
|
|
||||||
pg->idle_reserve_expiration_time));
|
|
||||||
struct GNUNET_TIME_Timestamp reserve_gc
|
|
||||||
= GNUNET_TIME_absolute_to_timestamp (
|
|
||||||
GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
|
|
||||||
pg->legal_reserve_expiration_time));
|
|
||||||
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (purse_pub),
|
GNUNET_PQ_query_param_auto_from_type (purse_pub),
|
||||||
GNUNET_PQ_query_param_auto_from_type (merge_sig),
|
GNUNET_PQ_query_param_auto_from_type (merge_sig),
|
||||||
GNUNET_PQ_query_param_timestamp (&merge_timestamp),
|
GNUNET_PQ_query_param_timestamp (&merge_timestamp),
|
||||||
GNUNET_PQ_query_param_timestamp (&reserve_expiration),
|
|
||||||
GNUNET_PQ_query_param_timestamp (&reserve_gc),
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (reserve_sig),
|
GNUNET_PQ_query_param_auto_from_type (reserve_sig),
|
||||||
GNUNET_PQ_query_param_bool (NULL == purse_fee),
|
GNUNET_PQ_query_param_bool (NULL == purse_fee),
|
||||||
TALER_PQ_query_param_amount (NULL == purse_fee
|
TALER_PQ_query_param_amount (NULL == purse_fee
|
||||||
@ -111,7 +100,7 @@ TEH_PG_do_reserve_purse (
|
|||||||
",out_no_reserve AS no_reserve"
|
",out_no_reserve AS no_reserve"
|
||||||
",out_conflict AS conflict"
|
",out_conflict AS conflict"
|
||||||
" FROM exchange_do_reserve_purse"
|
" FROM exchange_do_reserve_purse"
|
||||||
" ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);");
|
" ($1, $2, $3, $4, $5, $6, $7, $8, $9);");
|
||||||
|
|
||||||
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
||||||
"call_reserve_purse",
|
"call_reserve_purse",
|
||||||
|
@ -1157,13 +1157,8 @@ TEH_PG_get_reserve_status (void *cls,
|
|||||||
&rhc);
|
&rhc);
|
||||||
if ( (0 > qs) ||
|
if ( (0 > qs) ||
|
||||||
(GNUNET_OK != rhc.status) )
|
(GNUNET_OK != rhc.status) )
|
||||||
{
|
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
|
|
||||||
"Query %s failed\n",
|
|
||||||
work[i].statement);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ( (qs < 0) ||
|
if ( (qs < 0) ||
|
||||||
(rhc.status != GNUNET_OK) )
|
(rhc.status != GNUNET_OK) )
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ TEH_PG_reserves_in_insert (void *cls,
|
|||||||
(We are only run in a larger transaction for performance.) */
|
(We are only run in a larger transaction for performance.) */
|
||||||
enum GNUNET_DB_QueryStatus cs;
|
enum GNUNET_DB_QueryStatus cs;
|
||||||
|
|
||||||
cs = TEH_PG_commit (pg);
|
cs = TEH_PG_commit(pg);
|
||||||
if (cs < 0)
|
if (cs < 0)
|
||||||
return cs;
|
return cs;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
|
Loading…
Reference in New Issue
Block a user