diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer.ts | 6 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts b/packages/taler-wallet-core/src/operations/pay-peer.ts index 4dcc06076..5178839a4 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer.ts @@ -97,7 +97,6 @@ import { runLongpollAsync, runOperationWithErrorReporting, spendCoins, - storeOperationPending, } from "../operations/common.js"; import { readSuccessResponseJsonOrErrorCode, @@ -220,6 +219,11 @@ export async function selectPeerCoins( ws: InternalWalletState, instructedAmount: AmountJson, ): Promise<SelectPeerCoinsResult> { + if (Amounts.isZero(instructedAmount)) { + // Other parts of the code assume that we have at least + // one coin to spend. + throw new Error("amount of zero not allowed"); + } return await ws.db .mktx((x) => [ x.exchanges, diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index aba2948cd..3c3878792 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -118,8 +118,6 @@ import { } from "../versions.js"; import { makeTransactionId, - storeOperationError, - storeOperationPending, } from "./common.js"; import { getExchangeDetails, |