View Issue Details

IDProjectCategoryView StatusLast Update
0006187Talerexchangepublic2021-09-02 18:14
Reporteroec Assigned ToChristian Grothoff  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.7.1Fixed in Version0.7.1 
Summary0006187: Redundant copy of dki->issue.properties.fee_deposit
DescriptionIn exchange/taler-exchange-httpd_deposit.c:

 428 TALER_amount_ntoh (&deposit.deposit_fee,
 429 &dki->issue.properties.fee_deposit);
 430 if (GNUNET_YES !=
 431 TALER_amount_cmp_currency (&deposit.amount_with_fee,
 432 &deposit.deposit_fee) )
 ...
 455 TALER_amount_ntoh (&deposit.deposit_fee,
 456 &dki->issue.properties.fee_deposit);


The copies in line 428-429 and 455-456 are redundant.

For better readability I suggest to remove of the copy in 428-429 and compare directly against &dki->issue.properties.fee_deposit in 431-432.
TagsNo tags attached.

Activities

Christian Grothoff

2020-04-17 18:19

manager   ~0015680

The suggested fix doesn't work, as the cmp_currency function only works for the 'host byte order' version of 'account'. So we'd get a type error in that case. Anyway, I'll remove the redundant initialization in lines 455/456, nice catch.

Christian Grothoff

2020-04-17 18:20

manager   ~0015681

Fixed in 04d4922d..7a46b3fb

Christian Grothoff

2021-09-02 18:14

manager   ~0018264

Fix committed to master branch.

Related Changesets

exchange: master 1f7238fe

2020-04-17 20:14

Christian Grothoff


Details Diff
fix 0006187 Affected Issues
0006187
mod - src/exchange/taler-exchange-httpd_deposit.c Diff File

Issue History

Date Modified Username Field Change
2020-04-17 16:42 oec New Issue
2020-04-17 16:42 oec Status new => assigned
2020-04-17 16:42 oec Assigned To => Christian Grothoff
2020-04-17 18:14 Christian Grothoff Severity minor => tweak
2020-04-17 18:14 Christian Grothoff Product Version => git (master)
2020-04-17 18:19 Christian Grothoff Note Added: 0015680
2020-04-17 18:20 Christian Grothoff Status assigned => resolved
2020-04-17 18:20 Christian Grothoff Resolution open => fixed
2020-04-17 18:20 Christian Grothoff Fixed in Version => 0.7.1
2020-04-17 18:20 Christian Grothoff Note Added: 0015681
2020-04-17 18:20 Christian Grothoff Target Version => 0.7.1
2021-08-24 16:23 Christian Grothoff Status resolved => closed
2021-09-02 18:13 Christian Grothoff Changeset attached => Taler-exchange master 1f7238fe
2021-09-02 18:14 Christian Grothoff Note Added: 0018264