4 ms·
ATMs aren't as smart as the article says either: "the real code will check to see if there are sufficient funds". I noticed that (some?) ATMs around here tend
by edwintorok 13y ago
ATMs aren't as smart as the article says either: "the real code will check to see if there are sufficient funds".
I noticed that (some?) ATMs around here tend to implement this flawed algorithm, paraphrasing the article:
0. database.begin()
1. mybalance = database.read("account-number")
2. newbalance = mybalance - amount
3. database.write("account-number", newbalance)
4. database.commit()
5. dispense_cash(amount)
At first sight this might seem ACID, but its not. Consider what happens if the ATM is out of cash: step#5 fails, but the money was already withdrawn from your account!
It doesn't automatically revert the transaction either: you have to go to a branch office and ask for the transaction to be reverted. So much for atomic transactions at ATMs.
- dnmmnd 13y agoWhilst that maybe the way your bank has chosen to operate, it is most certainly possible for ATMs to report a step#5 failure to the banks host which will reverse the transaction.
- ams6110 13y agoWow I've never seen this happen. What happened to step -1: if (cash_in_machine < amount) abort
- threeseed 13y agoHe is talking about a failure to dispense the cash. I've had this happen twice to me whilst overseas.
- jasomill 13y agoInteresting. In one particularly ADHD-inspired case, I've also seen 5. Dispense cash 6. Wait a minute or so 7. Retract cash where 7 did not lead to a credit on my account until several days after I reported the problem to my bank. That's probably by design, however, since otherwise the machine would require automated defenses against surreptitious replacement of dispensed bills with counterfeits. Your example could be a similar failsafe against cases where the machine fails to properly dispense cash in a manner that nevertheless allows the cash to be retrieved. Otherwise you have to carefully separate errors that can't possibly lead to cash being dispensed (e.g., hopper empty) vs. those that might (e.g., bills jammed somewhere in the dispenser mechanism).
- dnmmnd 13y agoQuite so. If cash is presented to the customer and then retracted there isn't (or at least wasn't) a way for the ATM to know exactly what had been retracted, i.e. you requested amount X that required the ATM to dispense Y number of notes, but the ATM wouldn't know if the number of retracted notes Z was the same as Y. The ATM would have reported this event to the bank's host and would have been present in the daily transaction log. As you suggest, a customer initiated account credit is necessary to prevent fraud, and the failure to dispense claim can be verified against the host transaction log.