summaryrefslogtreecommitdiff
path: root/src/exchangedb/plugin_exchangedb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-23 11:55:10 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-23 11:55:10 +0200
commit727eccbe644aede46ef5eafc11964992960457e0 (patch)
treec97d05c90f929e0ddc15a0320636d68f079cb7f3 /src/exchangedb/plugin_exchangedb_postgres.c
parenta039bf4d81b4e2c01da6d21a7e36f209853f0c3f (diff)
downloadexchange-727eccbe644aede46ef5eafc11964992960457e0.tar.gz
exchange-727eccbe644aede46ef5eafc11964992960457e0.tar.bz2
exchange-727eccbe644aede46ef5eafc11964992960457e0.zip
add invariant checks for #6214
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index 4f57f32fe..e517d069b 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -4004,6 +4004,11 @@ struct CoinHistoryContext
* Set to 'true' if the transaction failed.
*/
bool failed;
+
+ /**
+ * Set to 'true' if we found a deposit (for invariant check).
+ */
+ bool have_deposit;
};
@@ -4029,6 +4034,7 @@ add_coin_deposit (void *cls,
struct TALER_EXCHANGEDB_TransactionList *tl;
uint64_t serial_id;
+ chc->have_deposit = true;
deposit = GNUNET_new (struct TALER_EXCHANGEDB_DepositListEntry);
{
struct GNUNET_PQ_ResultSpec rs[] = {
@@ -4506,6 +4512,7 @@ postgres_get_coin_transactions (
*tlp = chc.head;
if (NULL == chc.head)
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS;
+ GNUNET_break (chc.have_deposit);
return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
}