diff options
author | Florian Dold <florian@dold.me> | 2023-02-21 01:15:27 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-02-21 01:15:27 +0100 |
commit | e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34 (patch) | |
tree | f178d8d0b0994ec21a9d14a58ed5be49da571cb3 /packages/taler-wallet-core/src/operations/pay-peer.ts | |
parent | b9b1dd73f58c3ee66161fd316299c0a6772b0a0d (diff) | |
download | wallet-core-e56d3ba8ebc29c41e95505f3d3cdd6de62e7ce34.tar.xz |
taler-wallet-cli: make purse expiration configurable
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer.ts | 6 |
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, |