handle TALER_EXCHANGEDB_TT_PAYBACK in DB balance calulations

This commit is contained in:
Christian Grothoff 2017-04-03 13:57:17 +02:00
parent 94e9ba8710
commit e8f7674ca4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -178,6 +178,17 @@ calculate_transaction_list_totals (struct TALER_EXCHANGEDB_TransactionList *tl,
return GNUNET_SYSERR;
}
break;
case TALER_EXCHANGEDB_TT_PAYBACK:
/* spent += pos->value */
if (GNUNET_OK !=
TALER_amount_add (&spent,
&spent,
&pos->details.payback->value))
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
break;
}
}
/* spent = spent - refunded */
@ -429,6 +440,9 @@ TEH_DB_execute_refund (struct MHD_Connection *connection,
}
}
break;
case TALER_EXCHANGEDB_TT_PAYBACK:
/* Paybacks cannot be refunded, ignore here */
break;
}
}
/* handle if deposit was NOT found */