View Issue Details

IDProjectCategoryView StatusLast Update
0006214Talerexchangepublic2021-08-24 16:23
Reporteroec Assigned ToChristian Grothoff  
PrioritylowSeveritytweakReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.7.1Fixed in Version0.7.1 
Summary0006214: Suggestion: Introduce invariants check when dealing with TALER_EXCHANGEDB_TransactionList
DescriptionTEH_plugin->get_coin_transactions creates a linked list of TALER_EXCHANGEDB_TransactionList and TALER_EXCHANGEDB_calculate_transaction_list_totals iterates of such a list.

AFAIK, if there is no element of type TALER_EXCHANGEDB_TT_DEPOSIT in the linked list, it must be the empty list, correct?

I suggest to have additional GNUNET_assert statements in get_coin_transactions and maybe also in TALER_EXCHANGEDB_calculate_transaction_list_totals that check for those types of invariants. This would allow to catch inconsistencies in the database or bugs in the code early.
TagsNo tags attached.


Christian Grothoff

2020-04-23 11:38

manager   ~0015752

IMO we should not assert on information we get from our database, databases can be corrupt and we should ideally survive that. At least if the (SQL) constraints / schema of the DB hold, and we cannot formulate a sane constraint that says that there has to be a deposit.

We could possibly "GNUNET_break()" on this.


2020-04-23 11:44

developer   ~0015753

Yes, GNUNET_break() would already be helpful. It would at least communicate to a developer or code auditor the presence of such an invariant.

Christian Grothoff

2020-04-23 12:00

manager   ~0015755

Added in a039bf4d..727eccbe (in both functions).

Issue History

Date Modified Username Field Change
2020-04-23 11:34 oec New Issue
2020-04-23 11:34 oec Status new => assigned
2020-04-23 11:34 oec Assigned To => Christian Grothoff
2020-04-23 11:38 Christian Grothoff Note Added: 0015752
2020-04-23 11:44 oec Note Added: 0015753
2020-04-23 12:00 Christian Grothoff Note Added: 0015755
2020-04-23 12:00 Christian Grothoff Status assigned => resolved
2020-04-23 12:00 Christian Grothoff Resolution open => fixed
2020-04-23 12:00 Christian Grothoff Fixed in Version => 0.7.1
2020-04-23 12:00 Christian Grothoff Product Version => git (master)
2020-04-23 12:00 Christian Grothoff Target Version => 0.7.1
2021-08-24 16:23 Christian Grothoff Status resolved => closed