fix return value in auditor logic, and check it as well; adding FIXME to mark improperly handled case

This commit is contained in:
Christian Grothoff 2020-02-23 19:55:21 +01:00
parent 919861aea8
commit 65434a0e00
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -2572,11 +2572,11 @@ wire_transfer_information_cb (void *cls,
&issue); &issue);
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs)
{ {
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
GNUNET_CRYPTO_rsa_signature_free (coin.denom_sig.rsa_signature); GNUNET_CRYPTO_rsa_signature_free (coin.denom_sig.rsa_signature);
edb->free_coin_transaction_list (edb->cls, edb->free_coin_transaction_list (edb->cls,
tl); tl);
wcc->qs = qs; wcc->qs = qs;
if (0 == qs)
report_row_inconsistency ("aggregation", report_row_inconsistency ("aggregation",
rowid, rowid,
"could not find denomination key for coin claimed in aggregation"); "could not find denomination key for coin claimed in aggregation");
@ -2933,6 +2933,7 @@ check_wire_out_cb (void *cls,
&final_amount)) &final_amount))
{ {
GNUNET_break (0); GNUNET_break (0);
// FIXME: we should report an arithmetic error here!
ac->qs = GNUNET_DB_STATUS_HARD_ERROR; ac->qs = GNUNET_DB_STATUS_HARD_ERROR;
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
@ -3068,6 +3069,11 @@ analyze_aggregations (void *cls)
wfi); wfi);
GNUNET_free (wfi); GNUNET_free (wfi);
} }
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
/* there were no wire out entries to be looked at, we are done */
return qs;
}
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ac.qs) if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != ac.qs)
{ {
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == ac.qs); GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == ac.qs);
@ -5132,14 +5138,25 @@ transact (Analysis analysis,
else else
{ {
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Processing failed, rolling back transaction\n"); "Processing failed (or no changes), rolling back transaction\n");
adb->rollback (adb->cls, adb->rollback (adb->cls,
asession); asession);
edb->rollback (edb->cls, edb->rollback (edb->cls,
esession); esession);
} }
clear_transaction_state_cache (); clear_transaction_state_cache ();
return qs; switch (qs)
{
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
return GNUNET_OK;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
return GNUNET_OK;
case GNUNET_DB_STATUS_SOFT_ERROR:
return GNUNET_NO;
case GNUNET_DB_STATUS_HARD_ERROR:
return GNUNET_SYSERR;
}
return GNUNET_OK;
} }
@ -5166,14 +5183,18 @@ setup_sessions_and_run ()
return; return;
} }
GNUNET_break (GNUNET_SYSERR !=
transact (&analyze_reserves, transact (&analyze_reserves,
NULL); NULL));
GNUNET_break (GNUNET_SYSERR !=
transact (&analyze_aggregations, transact (&analyze_aggregations,
NULL); NULL));
GNUNET_break (GNUNET_SYSERR !=
transact (&analyze_coins, transact (&analyze_coins,
NULL); NULL));
GNUNET_break (GNUNET_SYSERR !=
transact (&analyze_deposit_confirmations, transact (&analyze_deposit_confirmations,
NULL); NULL));
} }