diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-04-06 15:49:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-06 15:49:13 +0200 |
commit | 595e0a05713710c537061c0e94069f346416391c (patch) | |
tree | a6697734dd7e0c2e5b1283ea389514a2ad4f976c /src | |
parent | 651298eb21664969908fc6bb8b9b126e953498e4 (diff) | |
download | merchant-595e0a05713710c537061c0e94069f346416391c.tar.gz merchant-595e0a05713710c537061c0e94069f346416391c.tar.bz2 merchant-595e0a05713710c537061c0e94069f346416391c.zip |
actually, the rollback() was redundant, instead introduce preflight checks
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/taler-merchant-httpd_pay.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c index 836e4bfa..ec52ff26 100644 --- a/src/backend/taler-merchant-httpd_pay.c +++ b/src/backend/taler-merchant-httpd_pay.c @@ -451,7 +451,6 @@ abort_deposit (struct PayContext *pc) dci->dh = NULL; } } - db->rollback (db->cls); } @@ -967,6 +966,7 @@ deposit_cb (void *cls, TALER_B2S (&pc->mi->pubkey)); /* NOTE: not run in any transaction block, simply as a transaction by itself! */ + db->preflight (db->cls); qs = db->store_deposit (db->cls, &pc->h_contract_terms, &pc->mi->pubkey, @@ -1103,6 +1103,7 @@ process_pay_with_exchange (void *cls, "Timing for this payment, wire_deadline: %llu, refund_deadline: %llu\n", (unsigned long long) pc->wire_transfer_deadline.abs_value_us, (unsigned long long) pc->refund_deadline.abs_value_us); + db->preflight (db->cls); dc->dh = TALER_EXCHANGE_deposit (mh, &dc->amount_with_fee, pc->wire_transfer_deadline, @@ -1151,6 +1152,7 @@ find_next_exchange (struct PayContext *pc) if (GNUNET_YES != dc->found_in_db) { + db->preflight (db->cls); pc->current_exchange = dc->exchange_url; pc->fo = TMH_EXCHANGES_find_exchange (pc->current_exchange, pc->wm->wire_method, @@ -1169,6 +1171,7 @@ find_next_exchange (struct PayContext *pc) } } pc->current_exchange = NULL; + db->preflight (db->cls); /* We are done with all the HTTP requests, go back and try the 'big' database transaction! (It should work now!) */ begin_transaction (pc); |