Skip to content

Commit

Permalink
fixup! overdrawn atomicity
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Feb 5, 2024
1 parent d26dce7 commit 5465c20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/ERTP/src/paymentLedger.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ export const preparePaymentLedger = (
const withdrawInternal = (balanceStore, amount, recoverySet) => {
amount = coerce(amount);
const payment = makePayment();
// COMMIT POINT Move the withdrawn assets from this purse into
// payment. Total assets must remain conserved.
balanceStore.decrement(amount) ||
Fail`Withdrawal of ${amount} failed because the purse only contained ${balanceStore.getAmount()}`;
try {
// COMMIT POINT Move the withdrawn assets from this purse into
// payment. Total assets must remain conserved.
balanceStore.decrement(amount) ||
Fail`Withdrawal of ${amount} failed because the purse only contained ${balanceStore.getAmount()}`;
initPayment(payment, amount, recoverySet);
} catch (err) {
shutdownLedgerWithFailure(err);
Expand Down

0 comments on commit 5465c20

Please sign in to comment.