diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-06-22 20:30:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-06-22 20:30:25 +0200 |
commit | 0748ecde7be1fb9537382d7cadc38031fbc696ff (patch) | |
tree | 9e4d6dbacb1e7d0c48d27e8f441f497d3a0f6cef /src/backenddb | |
parent | d83304e2a3af18480e3c83077c54a1b532904d2b (diff) | |
download | merchant-0748ecde7be1fb9537382d7cadc38031fbc696ff.tar.gz merchant-0748ecde7be1fb9537382d7cadc38031fbc696ff.tar.bz2 merchant-0748ecde7be1fb9537382d7cadc38031fbc696ff.zip |
return active-status of reserves from backenddb (fixes FIXMEs)
Diffstat (limited to 'src/backenddb')
-rw-r--r-- | src/backenddb/plugin_merchantdb_postgres.c | 22 |
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" |