diff options
Diffstat (limited to 'src/stasis/plugin_anastasis_postgres.c')
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index ef13c6c..bfe86da 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -334,9 +334,10 @@ prepare_statements (void *cls) ",recovery_data_hash" ",recovery_data" ",recovery_meta_data" + ",creation_date" ") VALUES " - "($1, $2, $3, $4, $5, $6);", - 6), + "($1, $2, $3, $4, $5, $6, $7);", + 7), GNUNET_PQ_make_prepare ("truth_select", "SELECT " " method_name" @@ -348,6 +349,7 @@ prepare_statements (void *cls) GNUNET_PQ_make_prepare ("recoverydocument_select_meta", "SELECT " " version" + ",creation_date" ",recovery_meta_data" " FROM anastasis_recoverydocument" " WHERE user_id=$1" @@ -1019,6 +1021,8 @@ postgres_store_recovery_document ( /* finally, actually insert the recovery document */ { + struct GNUNET_TIME_Timestamp now + = GNUNET_TIME_timestamp_get (); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_uint32 (version), @@ -1030,6 +1034,7 @@ postgres_store_recovery_document ( ? GNUNET_PQ_query_param_null () : GNUNET_PQ_query_param_fixed_size (recovery_meta_data, recovery_meta_data_size), + GNUNET_PQ_query_param_timestamp (&now), GNUNET_PQ_query_param_end }; @@ -2248,10 +2253,13 @@ meta_iterator (void *cls, uint32_t version; void *meta_data = NULL; size_t meta_data_size = 0; + struct GNUNET_TIME_Timestamp ts; bool unused = false; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_uint32 ("version", &version), + GNUNET_PQ_result_spec_timestamp ("creation_date", + &ts), GNUNET_PQ_result_spec_allow_null ( GNUNET_PQ_result_spec_variable_size ("recovery_meta_data", &meta_data, @@ -2272,6 +2280,7 @@ meta_iterator (void *cls, } ret = ctx->cb (ctx->cb_cls, version, + ts, meta_data, meta_data_size); GNUNET_PQ_cleanup_result (rs); |