Workaround: prevent signaling irregular coin inputs
This commit is contained in:
parent
ff4c52ddc9
commit
84859064a3
@ -89,10 +89,20 @@ void hwapi::hwapi_slotPrintFinished_Err(void) {
|
||||
|
||||
void hwapi::hwapi_slotGotCoin(void) {
|
||||
// new coin was inserted while transaction and new amount reported:
|
||||
emit hwapi_gotNewCoin();
|
||||
|
||||
uint32_t newSum=epi_CurrentPaymentGetAmount();
|
||||
|
||||
// this slot is called sometimes irregularely and providing
|
||||
// invalid sums!
|
||||
// TODO: preveent irregular call. Meanwhile, we need this
|
||||
// limit check: 75000Ft ~200€
|
||||
if (newSum > 75000) {
|
||||
qCritical() << "Fixme: irregular gotNewCoin() signal";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
emit hwapi_gotNewCoin();
|
||||
|
||||
if (newSum>=hwapi_lastStartAmount)
|
||||
emit hwapi_payStopByMax();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user