aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-16 17:45:05 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-16 17:45:05 +0100
commitfaf3f57ce3582a5b9f1070d689827bccd0183cd4 (patch)
tree6510265d7e69b1309cac68ba53d57f6d386eaf9e /src/exchangedb
parent8563dcc8452d243ec63f98f0b63b48aa82c050a3 (diff)
downloadexchange-faf3f57ce3582a5b9f1070d689827bccd0183cd4.tar.xz
do not 500 on empty reserve history by not ignoring undecided purses that may have caused reserve to be created in the first place
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/exchange_do_reserve_purse.sql4
-rw-r--r--src/exchangedb/pg_get_reserve_history.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/exchangedb/exchange_do_reserve_purse.sql b/src/exchangedb/exchange_do_reserve_purse.sql
index 4f65c6606..0476e60d1 100644
--- a/src/exchangedb/exchange_do_reserve_purse.sql
+++ b/src/exchangedb/exchange_do_reserve_purse.sql
@@ -161,7 +161,3 @@ END $$;
COMMENT ON FUNCTION exchange_do_reserve_purse(BYTEA, BYTEA, INT8, INT8, INT8, BYTEA, BOOLEAN, INT8, INT4, BYTEA, BYTEA)
IS 'Create a purse for a reserve.';
-
-
-
-
diff --git a/src/exchangedb/pg_get_reserve_history.c b/src/exchangedb/pg_get_reserve_history.c
index 89701ae71..6c12abc61 100644
--- a/src/exchangedb/pg_get_reserve_history.c
+++ b/src/exchangedb/pg_get_reserve_history.c
@@ -797,14 +797,14 @@ TEH_PG_get_reserve_history (void *cls,
" FROM purse_merges pm"
" JOIN purse_requests pr"
" USING (purse_pub)"
- " JOIN purse_decision pdes"
+ " LEFT JOIN purse_decision pdes"
" USING (purse_pub)"
" JOIN account_merges am"
" ON (am.purse_pub = pm.purse_pub AND"
" am.reserve_pub = pm.reserve_pub)"
" WHERE pm.reserve_pub=$1"
" AND COALESCE(pm.partner_serial_id,0)=0" /* must be local! */
- " AND NOT pdes.refunded;");
+ " AND NOT COALESCE (pdes.refunded, FALSE);");
PREPARE (pg,
"history_by_reserve",
"SELECT"
@@ -855,7 +855,12 @@ TEH_PG_get_reserve_history (void *cls,
&rhc);
if ( (0 > qs) ||
(GNUNET_OK != rhc.status) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Failed to compile reserve history at `%s'\n",
+ work[i].statement);
break;
+ }
}
if ( (qs < 0) ||
(rhc.status != GNUNET_OK) )