summaryrefslogtreecommitdiff
path: root/src/backenddb
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-22 16:35:21 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-06-22 16:36:45 -0400
commit66f0f2d7acaba870e2b8aa18cddcecb2a30cee2d (patch)
tree976bee01b304b5675a7b8b3821673f9e3458ae57 /src/backenddb
parentcac09657404fa6075fad0e09b6a855b4110f792d (diff)
parent0748ecde7be1fb9537382d7cadc38031fbc696ff (diff)
downloadmerchant-66f0f2d7acaba870e2b8aa18cddcecb2a30cee2d.tar.gz
merchant-66f0f2d7acaba870e2b8aa18cddcecb2a30cee2d.tar.bz2
merchant-66f0f2d7acaba870e2b8aa18cddcecb2a30cee2d.zip
Merge branch 'protocolV1' of ssh://git.taler.net/merchant into protocolV1
Diffstat (limited to 'src/backenddb')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 54719940..fc1e3acc 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -4341,7 +4341,7 @@ lookup_reserves_cb (void *cls,
struct TALER_Amount exchange_initial_balance;
struct TALER_Amount pickup_amount;
struct TALER_Amount committed_amount;
- uint8_t active = 0;
+ uint8_t active;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_auto_from_type ("reserve_pub",
&reserve_pub),
@@ -4357,8 +4357,8 @@ lookup_reserves_cb (void *cls,
&committed_amount),
TALER_PQ_RESULT_SPEC_AMOUNT ("tips_picked_up",
&pickup_amount),
- /*GNUNET_PQ_result_spec_auto_from_type ("active",
- &active), FIXME: 'active'*/
+ GNUNET_PQ_result_spec_auto_from_type ("active",
+ &active),
GNUNET_PQ_result_spec_end
};
@@ -4374,10 +4374,10 @@ lookup_reserves_cb (void *cls,
switch (lrc->active)
{
case TALER_EXCHANGE_YNA_YES:
- if (! active)
+ if (0 == active)
continue;
case TALER_EXCHANGE_YNA_NO:
- if (active)
+ if (0 != active)
continue;
case TALER_EXCHANGE_YNA_ALL:
break;
@@ -4682,7 +4682,7 @@ postgres_lookup_reserve (void *cls,
struct TALER_Amount exchange_initial_balance;
struct TALER_Amount pickup_amount;
struct TALER_Amount committed_amount;
- /*uint8_t active;*/
+ uint8_t active;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_absolute_time ("creation_time",
&creation_time),
@@ -4696,8 +4696,8 @@ postgres_lookup_reserve (void *cls,
&pickup_amount),
TALER_PQ_RESULT_SPEC_AMOUNT ("tips_committed",
&committed_amount),
- /*GNUNET_PQ_result_spec_auto_from_type ("active",
- &active), FIXME: active! */
+ GNUNET_PQ_result_spec_auto_from_type ("active",
+ &active),
GNUNET_PQ_result_spec_end
};
enum GNUNET_DB_QueryStatus qs;
@@ -4718,6 +4718,7 @@ postgres_lookup_reserve (void *cls,
&exchange_initial_balance,
&pickup_amount,
&committed_amount,
+ (0 != active),
0,
NULL);
return qs;
@@ -4739,6 +4740,7 @@ postgres_lookup_reserve (void *cls,
&exchange_initial_balance,
&pickup_amount,
&committed_amount,
+ 0 != active,
ltc.tips_length,
ltc.tips);
}
@@ -7789,7 +7791,9 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
",tips_committed_frac"
",tips_picked_up_val"
",tips_picked_up_frac"
+ ",reserve_priv IS NOT NULL AS active"
" FROM merchant_tip_reserves"
+ " FULL OUTER JOIN merchant_tip_reserve_keys USING (reserve_serial)"
" WHERE creation_time > $2"
" AND merchant_serial ="
" (SELECT merchant_serial"
@@ -7823,7 +7827,9 @@ libtaler_plugin_merchantdb_postgres_init (void *cls)
",tips_committed_frac"
",tips_picked_up_val"
",tips_picked_up_frac"
+ ",reserve_priv IS NOT NULL AS active"
" FROM merchant_tip_reserves"
+ " FULL OUTER JOIN merchant_tip_reserve_keys USING (reserve_serial)"
" WHERE reserve_pub = $2"
" AND merchant_serial ="
" (SELECT merchant_serial"