-starting point for Joseph
This commit is contained in:
parent
9d43bf92c4
commit
505ea0a043
@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
enum GNUNET_DB_QueryStatus
|
enum GNUNET_DB_QueryStatus
|
||||||
TEH_PG_get_ready_deposit (void *cls,
|
TEH_PG_get_ready_deposit (void *cls,
|
||||||
uint64_t start_shard_row,
|
uint64_t start_shard_row,
|
||||||
uint64_t end_shard_row,
|
uint64_t end_shard_row,
|
||||||
struct TALER_MerchantPublicKeyP *merchant_pub,
|
struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||||
char **payto_uri)
|
char **payto_uri)
|
||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct GNUNET_TIME_Absolute now = {0};
|
struct GNUNET_TIME_Absolute now = {0};
|
||||||
@ -57,9 +57,6 @@ TEH_PG_get_ready_deposit (void *cls,
|
|||||||
"Finding ready deposits by deadline %s (%llu)\n",
|
"Finding ready deposits by deadline %s (%llu)\n",
|
||||||
GNUNET_TIME_absolute2s (now),
|
GNUNET_TIME_absolute2s (now),
|
||||||
(unsigned long long) now.abs_value_us);
|
(unsigned long long) now.abs_value_us);
|
||||||
|
|
||||||
|
|
||||||
/* Used in #postgres_get_ready_deposit() */
|
|
||||||
PREPARE (pg,
|
PREPARE (pg,
|
||||||
"deposits_get_ready",
|
"deposits_get_ready",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
@ -78,17 +75,8 @@ TEH_PG_get_ready_deposit (void *cls,
|
|||||||
" dbr.wire_deadline ASC"
|
" dbr.wire_deadline ASC"
|
||||||
" ,dbr.shard ASC"
|
" ,dbr.shard ASC"
|
||||||
" LIMIT 1;");
|
" LIMIT 1;");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
||||||
"deposits_get_ready",
|
"deposits_get_ready",
|
||||||
params,
|
params,
|
||||||
rs);
|
rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,19 +119,35 @@ TEH_PG_select_refunds_by_coin (
|
|||||||
.status = GNUNET_OK
|
.status = GNUNET_OK
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Query the 'refunds' by coin public key */
|
if (NULL == getenv ("NEW_LOGIC"))
|
||||||
/* Query the 'refunds' by coin public key, merchant_pub and contract hash */
|
{
|
||||||
PREPARE (pg,
|
PREPARE (pg,
|
||||||
"get_refunds_by_coin_and_contract",
|
"get_refunds_by_coin_and_contract",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
" ref.amount_with_fee_val"
|
" ref.amount_with_fee_val"
|
||||||
",ref.amount_with_fee_frac"
|
",ref.amount_with_fee_frac"
|
||||||
" FROM refunds ref"
|
" FROM refunds ref"
|
||||||
" JOIN deposits dep"
|
" JOIN deposits dep"
|
||||||
" USING (coin_pub,deposit_serial_id)"
|
" USING (coin_pub,deposit_serial_id)"
|
||||||
" WHERE ref.coin_pub=$1"
|
" WHERE ref.coin_pub=$1"
|
||||||
" AND dep.merchant_pub=$2"
|
" AND dep.merchant_pub=$2"
|
||||||
" AND dep.h_contract_terms=$3;");
|
" AND dep.h_contract_terms=$3;");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// FIXME-Joseph
|
||||||
|
PREPARE (pg,
|
||||||
|
"get_refunds_by_coin_and_contract",
|
||||||
|
"SELECT"
|
||||||
|
" ref.amount_with_fee_val"
|
||||||
|
",ref.amount_with_fee_frac"
|
||||||
|
" FROM refunds ref"
|
||||||
|
" JOIN deposits dep"
|
||||||
|
" USING (coin_pub,deposit_serial_id)"
|
||||||
|
" WHERE ref.coin_pub=$1"
|
||||||
|
" AND dep.merchant_pub=$2"
|
||||||
|
" AND dep.h_contract_terms=$3;");
|
||||||
|
}
|
||||||
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
|
qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
|
||||||
"get_refunds_by_coin_and_contract",
|
"get_refunds_by_coin_and_contract",
|
||||||
params,
|
params,
|
||||||
|
Loading…
Reference in New Issue
Block a user