This commit is contained in:
Christian Grothoff 2020-04-22 21:21:48 +02:00
parent 092944819d
commit a039bf4d81
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -4001,9 +4001,9 @@ struct CoinHistoryContext
struct PostgresClosure *pg; struct PostgresClosure *pg;
/** /**
* Set to transaction status. * Set to 'true' if the transaction failed.
*/ */
enum GNUNET_DB_QueryStatus status; bool failed;
}; };
@ -4064,7 +4064,7 @@ add_coin_deposit (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (deposit); GNUNET_free (deposit);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
} }
@ -4124,7 +4124,7 @@ add_coin_melt (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (melt); GNUNET_free (melt);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
} }
@ -4187,7 +4187,7 @@ add_coin_refund (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (refund); GNUNET_free (refund);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
} }
@ -4253,7 +4253,7 @@ add_old_coin_recoup (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (recoup); GNUNET_free (recoup);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
recoup->old_coin_pub = *chc->coin_pub; recoup->old_coin_pub = *chc->coin_pub;
@ -4315,7 +4315,7 @@ add_coin_recoup (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (recoup); GNUNET_free (recoup);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
} }
@ -4381,7 +4381,7 @@ add_coin_recoup_refresh (void *cls,
{ {
GNUNET_break (0); GNUNET_break (0);
GNUNET_free (recoup); GNUNET_free (recoup);
chc->status = GNUNET_DB_STATUS_HARD_ERROR; chc->failed = true;
return; return;
} }
recoup->coin.coin_pub = *chc->coin_pub; recoup->coin.coin_pub = *chc->coin_pub;
@ -4474,7 +4474,6 @@ postgres_get_coin_transactions (
const struct Work *work; const struct Work *work;
struct CoinHistoryContext chc = { struct CoinHistoryContext chc = {
.head = NULL, .head = NULL,
.status = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT,
.coin_pub = coin_pub, .coin_pub = coin_pub,
.session = session, .session = session,
.pg = pg, .pg = pg,
@ -4493,14 +4492,14 @@ postgres_get_coin_transactions (
work[i].cb, work[i].cb,
&chc); &chc);
if ( (0 > qs) || if ( (0 > qs) ||
(GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != chc.status) ) (chc.failed) )
{ {
if (NULL != chc.head) if (NULL != chc.head)
common_free_coin_transaction_list (cls, common_free_coin_transaction_list (cls,
chc.head); chc.head);
*tlp = NULL; *tlp = NULL;
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != chc.status) if (chc.failed)
qs = chc.status; qs = GNUNET_DB_STATUS_HARD_ERROR;
return qs; return qs;
} }
} }