Module 5 · Interview Prep: A P2P Wallet and Ledger Lesson 32 of 54
Two Spends at Once, and a Deadlock
Never below zero under pressure, and locking accounts in a fixed order.
Transcript
28 sentences · select one to jump thereCheck your understanding
Sara (account 17) sends Omar (account 42) $50 while Omar sends Sara $20. How do you avoid a deadlock?
Lesson notes
The rule
Check and debit in one locked step, and always lock accounts smallest ID first