Commit 4712d24
fix(evm-wallet-experiment): reserve spend budget before await, rollback on failure
Committing after redeemFn resolved left a window where two concurrent
calls could both pass the remaining() check and together exceed the
budget. Commit before the await to atomically reserve the budget, then
rollback if redeemFn throws. This is the pattern rollback() was designed
for but was never called.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6d32cb0 commit 4712d24
1 file changed
Lines changed: 10 additions & 4 deletions
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
190 | 197 | | |
191 | | - | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
0 commit comments