diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-08-19 16:01:57 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-08-19 16:01:57 +0200 |
commit | 0df2028f96f5977739d4659bf253e0c6d9468326 (patch) | |
tree | 906222af6c332e219af4a5d112891d7212237de3 /src/exchangedb/perf_taler_exchangedb_interpreter.c | |
parent | ddca1f5c68e112928d715e1aee2758c40e14fb51 (diff) | |
download | exchange-0df2028f96f5977739d4659bf253e0c6d9468326.tar.gz exchange-0df2028f96f5977739d4659bf253e0c6d9468326.tar.bz2 exchange-0df2028f96f5977739d4659bf253e0c6d9468326.zip |
make transactions smaller to try to reduce rollbacks
Diffstat (limited to 'src/exchangedb/perf_taler_exchangedb_interpreter.c')
-rw-r--r-- | src/exchangedb/perf_taler_exchangedb_interpreter.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/exchangedb/perf_taler_exchangedb_interpreter.c b/src/exchangedb/perf_taler_exchangedb_interpreter.c index 43891e55f..2d0ec396c 100644 --- a/src/exchangedb/perf_taler_exchangedb_interpreter.c +++ b/src/exchangedb/perf_taler_exchangedb_interpreter.c @@ -1205,6 +1205,10 @@ interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state) deposit_index = state->cmd[state->i].details.insert_deposit.index_deposit; deposit = state->cmd[deposit_index].exposed.data.deposit; + qs = state->plugin->ensure_coin_known (state->plugin->cls, + state->session, + &deposit->coin); + GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs); qs = state->plugin->insert_deposit (state->plugin->cls, state->session, deposit); @@ -1434,7 +1438,11 @@ interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state) &refresh_session.amount_with_fee)); refresh_session.noreveal_index = 1; GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == - state->plugin->insert_melt (state->session, + state->plugin->ensure_coin_known (state->plugin->cls, + state->session, + &refresh_session.coin)); + GNUNET_assert (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == + state->plugin->insert_melt (state->plugin->cls, state->session, &refresh_session)); state->cmd[state->i].exposed.data.rc = refresh_session.rc; @@ -1449,7 +1457,7 @@ interpret (struct PERF_TALER_EXCHANGEDB_interpreter_state *state) hash_index = state->cmd[state->i].details.get_refresh_session.index_hash; rc = &state->cmd[hash_index].exposed.data.rc; - state->plugin->get_melt (state->session, + state->plugin->get_melt (state->plugin->cls, state->session, rc, &refresh); |