diff --git a/src/hwapi.cpp b/src/hwapi.cpp index b41c27d..95f55c8 100644 --- a/src/hwapi.cpp +++ b/src/hwapi.cpp @@ -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();