I have a ledger running with an account type set to positive_only true. See the Wallet account type in the following:
https://github.com/sudhirj/notecase/blob/master/config/initializers/double_entry.rb
This works fine normally, but on a very small minority of cases where transactions come in at almost the same time, I've seen account balances go negative. Is there anything that can be done to avoid this? Both accounts are being locked as follows:
https://github.com/sudhirj/notecase/blob/master/app/models/transaction.rb
Any ideas on how we can improve the integrity of positive_only accounts?