Compare commits
2 Commits
17001e445d
...
ee42b70692
Author | SHA1 | Date | |
---|---|---|---|
ee42b70692 | |||
eeece1c96d |
@ -740,7 +740,6 @@ age_withdraw_transaction (void *cls,
|
|||||||
bool age_ok = false;
|
bool age_ok = false;
|
||||||
bool conflict = false;
|
bool conflict = false;
|
||||||
uint16_t allowed_maximum_age = 0;
|
uint16_t allowed_maximum_age = 0;
|
||||||
uint64_t ruuid;
|
|
||||||
|
|
||||||
qs = TEH_plugin->do_age_withdraw (TEH_plugin->cls,
|
qs = TEH_plugin->do_age_withdraw (TEH_plugin->cls,
|
||||||
&awc->commitment,
|
&awc->commitment,
|
||||||
@ -749,8 +748,7 @@ age_withdraw_transaction (void *cls,
|
|||||||
&balance_ok,
|
&balance_ok,
|
||||||
&age_ok,
|
&age_ok,
|
||||||
&allowed_maximum_age,
|
&allowed_maximum_age,
|
||||||
&conflict,
|
&conflict);
|
||||||
&ruuid);
|
|
||||||
if (0 > qs)
|
if (0 > qs)
|
||||||
{
|
{
|
||||||
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
|
if (GNUNET_DB_STATUS_HARD_ERROR == qs)
|
||||||
|
@ -128,8 +128,8 @@ libtaler_plugin_exchangedb_postgres_la_SOURCES = \
|
|||||||
pg_drain_kyc_alert.h pg_drain_kyc_alert.c \
|
pg_drain_kyc_alert.h pg_drain_kyc_alert.c \
|
||||||
pg_reserves_in_insert.h pg_reserves_in_insert.c \
|
pg_reserves_in_insert.h pg_reserves_in_insert.c \
|
||||||
pg_get_withdraw_info.h pg_get_withdraw_info.c \
|
pg_get_withdraw_info.h pg_get_withdraw_info.c \
|
||||||
pg_get_age_withdraw.c pg_get_age_withdraw.h \
|
|
||||||
pg_do_age_withdraw.h pg_do_age_withdraw.c \
|
pg_do_age_withdraw.h pg_do_age_withdraw.c \
|
||||||
|
pg_get_age_withdraw.h pg_get_age_withdraw.c \
|
||||||
pg_batch_ensure_coin_known.h pg_batch_ensure_coin_known.c \
|
pg_batch_ensure_coin_known.h pg_batch_ensure_coin_known.c \
|
||||||
pg_do_batch_withdraw.h pg_do_batch_withdraw.c \
|
pg_do_batch_withdraw.h pg_do_batch_withdraw.c \
|
||||||
pg_get_policy_details.h pg_get_policy_details.c \
|
pg_get_policy_details.h pg_get_policy_details.c \
|
||||||
|
@ -32,8 +32,7 @@ CREATE OR REPLACE FUNCTION exchange_do_age_withdraw(
|
|||||||
OUT balance_ok BOOLEAN,
|
OUT balance_ok BOOLEAN,
|
||||||
OUT age_ok BOOLEAN,
|
OUT age_ok BOOLEAN,
|
||||||
OUT required_age INT2, -- in years ϵ [0,1..)
|
OUT required_age INT2, -- in years ϵ [0,1..)
|
||||||
OUT conflict BOOLEAN,
|
OUT conflict BOOLEAN)
|
||||||
OUT ruuid INT8)
|
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
AS $$
|
AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
@ -55,13 +54,11 @@ SELECT
|
|||||||
,current_balance_frac
|
,current_balance_frac
|
||||||
,gc_date
|
,gc_date
|
||||||
,birthday
|
,birthday
|
||||||
,reserve_uuid
|
|
||||||
INTO
|
INTO
|
||||||
reserve_val
|
reserve_val
|
||||||
,reserve_frac
|
,reserve_frac
|
||||||
,reserve_gc
|
,reserve_gc
|
||||||
,reserve_birthday
|
,reserve_birthday
|
||||||
,ruuid
|
|
||||||
FROM exchange.reserves
|
FROM exchange.reserves
|
||||||
WHERE reserves.reserve_pub=rpub;
|
WHERE reserves.reserve_pub=rpub;
|
||||||
|
|
||||||
@ -73,7 +70,6 @@ THEN
|
|||||||
age_ok=FALSE;
|
age_ok=FALSE;
|
||||||
required_age=0;
|
required_age=0;
|
||||||
conflict=FALSE;
|
conflict=FALSE;
|
||||||
ruuid=2;
|
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
* @param[out] age_ok set to true if no age requirements are present on the reserve
|
* @param[out] age_ok set to true if no age requirements are present on the reserve
|
||||||
* @param[out] required_age if @e age_ok is false, set to the maximum allowed age when withdrawing from this reserve
|
* @param[out] required_age if @e age_ok is false, set to the maximum allowed age when withdrawing from this reserve
|
||||||
* @param[out] conflict set to true if there already is an entry in the database for the given pair (h_commitment, reserve_pub)
|
* @param[out] conflict set to true if there already is an entry in the database for the given pair (h_commitment, reserve_pub)
|
||||||
* @param[out] ruuid set to the reserve's UUID (reserves table row)
|
|
||||||
* @return query execution status
|
* @return query execution status
|
||||||
*/
|
*/
|
||||||
enum GNUNET_DB_QueryStatus
|
enum GNUNET_DB_QueryStatus
|
||||||
@ -49,7 +48,6 @@ TEH_PG_do_age_withdraw (
|
|||||||
bool *balance_ok,
|
bool *balance_ok,
|
||||||
bool *age_ok,
|
bool *age_ok,
|
||||||
uint16_t *required_age,
|
uint16_t *required_age,
|
||||||
bool *conflict,
|
bool *conflict);
|
||||||
uint64_t *ruuid);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,6 +21,7 @@ SET search_path TO exchange;
|
|||||||
#include "exchange_do_withdraw.sql"
|
#include "exchange_do_withdraw.sql"
|
||||||
#include "exchange_do_batch_withdraw.sql"
|
#include "exchange_do_batch_withdraw.sql"
|
||||||
#include "exchange_do_batch_withdraw_insert.sql"
|
#include "exchange_do_batch_withdraw_insert.sql"
|
||||||
|
#include "exchange_do_age_withdraw.sql"
|
||||||
#include "exchange_do_recoup_by_reserve.sql"
|
#include "exchange_do_recoup_by_reserve.sql"
|
||||||
#include "exchange_do_deposit.sql"
|
#include "exchange_do_deposit.sql"
|
||||||
#include "exchange_do_melt.sql"
|
#include "exchange_do_melt.sql"
|
||||||
|
@ -3856,7 +3856,6 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
* @param[out] balance_ok set to true if the balance was sufficient
|
* @param[out] balance_ok set to true if the balance was sufficient
|
||||||
* @param[out] age_ok set to true if age requirements were met
|
* @param[out] age_ok set to true if age requirements were met
|
||||||
* @param[out] allowed_maximum_age if @e age_ok is FALSE, this is set to the allowed maximum age
|
* @param[out] allowed_maximum_age if @e age_ok is FALSE, this is set to the allowed maximum age
|
||||||
* @param[out] ruuid set to the reserve's UUID (reserves table row)
|
|
||||||
* @return query execution status
|
* @return query execution status
|
||||||
*/
|
*/
|
||||||
enum GNUNET_DB_QueryStatus
|
enum GNUNET_DB_QueryStatus
|
||||||
@ -3868,8 +3867,7 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
bool *balance_ok,
|
bool *balance_ok,
|
||||||
bool *age_ok,
|
bool *age_ok,
|
||||||
uint16_t *allowed_maximum_age,
|
uint16_t *allowed_maximum_age,
|
||||||
bool *conflict,
|
bool *conflict);
|
||||||
uint64_t *ruuid);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the details to a policy given by its hash_code
|
* Retrieve the details to a policy given by its hash_code
|
||||||
|
Loading…
Reference in New Issue
Block a user