diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bank-lib/bank_api_credit.c | 31 | ||||
-rw-r--r-- | src/bank-lib/bank_api_debit.c | 31 | ||||
-rw-r--r-- | src/benchmark/taler-exchange-benchmark.c | 11 | ||||
-rw-r--r-- | src/exchange/taler-exchange-wirewatch.c | 4 |
4 files changed, 49 insertions, 28 deletions
diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c index 551831d2..4b6f40bb 100644 --- a/src/bank-lib/bank_api_credit.c +++ b/src/bank-lib/bank_api_credit.c @@ -113,12 +113,18 @@ parse_account_history (struct TALER_BANK_CreditHistoryHandle *hh, GNUNET_break_op (0); return GNUNET_SYSERR; } - hh->hcb (hh->hcb_cls, - MHD_HTTP_OK, - TALER_EC_NONE, - row_id, - &td, - transaction); + if (GNUNET_OK != + hh->hcb (hh->hcb_cls, + MHD_HTTP_OK, + TALER_EC_NONE, + row_id, + &td, + transaction)) + { + hh->hcb = NULL; + GNUNET_JSON_parse_free (hist_spec); + return GNUNET_OK; + } GNUNET_JSON_parse_free (hist_spec); } return GNUNET_OK; @@ -195,12 +201,13 @@ handle_credit_history_finished (void *cls, response_code = 0; break; } - hh->hcb (hh->hcb_cls, - response_code, - ec, - 0LLU, - NULL, - j); + if (NULL != hh->hcb) + hh->hcb (hh->hcb_cls, + response_code, + ec, + 0LLU, + NULL, + j); TALER_BANK_credit_history_cancel (hh); } diff --git a/src/bank-lib/bank_api_debit.c b/src/bank-lib/bank_api_debit.c index 1418492e..33ff20ef 100644 --- a/src/bank-lib/bank_api_debit.c +++ b/src/bank-lib/bank_api_debit.c @@ -115,12 +115,18 @@ parse_account_history (struct TALER_BANK_DebitHistoryHandle *hh, GNUNET_break_op (0); return GNUNET_SYSERR; } - hh->hcb (hh->hcb_cls, - MHD_HTTP_OK, - TALER_EC_NONE, - row_id, - &td, - transaction); + if (GNUNET_OK != + hh->hcb (hh->hcb_cls, + MHD_HTTP_OK, + TALER_EC_NONE, + row_id, + &td, + transaction)) + { + hh->hcb = NULL; + GNUNET_JSON_parse_free (hist_spec); + return GNUNET_OK; + } GNUNET_JSON_parse_free (hist_spec); } return GNUNET_OK; @@ -199,12 +205,13 @@ handle_debit_history_finished (void *cls, response_code = 0; break; } - hh->hcb (hh->hcb_cls, - response_code, - ec, - 0LLU, - NULL, - j); + if (NULL != hh->hcb) + hh->hcb (hh->hcb_cls, + response_code, + ec, + 0LLU, + NULL, + j); TALER_BANK_debit_history_cancel (hh); } diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index 95c3ae23..8bfbc42a 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -297,6 +297,9 @@ eval_probability (float probability) } +static int reserves_first = 1; + + /** * Actual commands construction and execution. * @@ -355,7 +358,9 @@ run (void *cls, GNUNET_asprintf (&batch_label, "batch-start-%u", j); - all_commands[j * (howmany_coins + 1)] + all_commands[reserves_first + ? j + : j * (howmany_coins + 1)] = TALER_TESTING_cmd_batch (add_label (batch_label), make_reserve); } @@ -433,7 +438,9 @@ run (void *cls, "unit-%u-%u", i, j); - all_commands[j * (howmany_coins + 1) + (1 + i)] + all_commands[reserves_first + ? howmany_reserves + j * howmany_coins + i + : j * (howmany_coins + 1) + (1 + i)] = TALER_TESTING_cmd_batch (add_label (unit_label), unit); } diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index 04bf2169..ede6220b 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -455,8 +455,8 @@ history_cb (void *cls, } if (GNUNET_DB_STATUS_SOFT_ERROR == qs) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Got DB soft error for reserve_in_insert\n"); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Got DB soft error for reserves_in_insert. Rolling back.\n"); db_plugin->rollback (db_plugin->cls, session); /* try again */ |