summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay-peer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer.ts6
1 files changed, 5 insertions, 1 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,