diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts index 725e3f3d9..88bdcb90e 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts @@ -29,6 +29,7 @@ import { NotificationType, TalerErrorCode, TalerPreciseTimestamp, + TalerProtocolTimestamp, TalerUriAction, TransactionAction, TransactionMajorState, @@ -64,12 +65,11 @@ import { PendingTaskType } from "../pending-types.js"; import { assertUnreachable } from "../util/assertUnreachable.js"; import { checkDbInvariant } from "../util/invariants.js"; import { + LongpollResult, OperationAttemptResult, OperationAttemptResultType, constructTaskIdentifier, - LongpollResult, runLongpollAsync, - runTaskWithErrorReporting, } from "./common.js"; import { codecForExchangePurseStatus, @@ -84,7 +84,6 @@ import { import { getExchangeWithdrawalInfo, internalCreateWithdrawalGroup, - processWithdrawalGroup, } from "./withdraw.js"; const logger = new Logger("pay-peer-pull-credit.ts"); @@ -121,7 +120,9 @@ async function queryPurseForPeerPullCredit( } } - if (!result.response.deposit_timestamp) { + const depositTimestamp = result.response.deposit_timestamp; + + if (!depositTimestamp || TalerProtocolTimestamp.isNever(depositTimestamp)) { logger.info("purse not ready yet (no deposit)"); return { ready: false }; } @@ -314,9 +315,7 @@ async function handlePeerPullCreditWithdrawing( const transitionInfo = await ws.db .mktx((x) => [x.peerPullPaymentInitiations, x.withdrawalGroups]) .runReadWrite(async (tx) => { - const ppi = await tx.peerPullPaymentInitiations.get( - pullIni.pursePub, - ); + const ppi = await tx.peerPullPaymentInitiations.get(pullIni.pursePub); if (!ppi) { finished = true; return; @@ -653,7 +652,7 @@ export async function checkPeerPullPaymentInitiation( let numCoins = 0; for (let i = 0; i < wi.selectedDenoms.selectedDenoms.length; i++) { numCoins += wi.selectedDenoms.selectedDenoms[i].count; - } + } return { exchangeBaseUrl: exchangeUrl, |