diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-18 17:31:34 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-18 17:31:34 -0300 |
commit | 4bd9b1ba79af12d5916e0ab308acd40935a813ec (patch) | |
tree | 9da351522da349cff152bd3d1df9d9b817455c3f /packages/taler-wallet-core/src/operations/pay-peer.ts | |
parent | 20b9e62aa1d9ae84ddcf8f36f60515021d3f9210 (diff) | |
download | wallet-core-4bd9b1ba79af12d5916e0ab308acd40935a813ec.tar.xz |
fix: missing total cost in peer pull payment
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts b/packages/taler-wallet-core/src/operations/pay-peer.ts index 48434e452..7dc7b67fe 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer.ts @@ -882,6 +882,11 @@ export async function acceptPeerPullPayment( const sel = coinSelRes.result; + const totalAmount = await getTotalPeerPaymentCost( + ws, + coinSelRes.result.coins, + ); + await ws.db .mktx((x) => [ x.exchanges, @@ -908,6 +913,7 @@ export async function acceptPeerPullPayment( throw Error(); } pi.status = PeerPullPaymentIncomingStatus.Accepted; + pi.totalCost = Amounts.stringify(totalAmount); await tx.peerPullPaymentIncoming.put(pi); }); @@ -995,6 +1001,7 @@ export async function checkPeerPullPayment( timestampCreated: TalerProtocolTimestamp.now(), contractTerms: dec.contractTerms, status: PeerPullPaymentIncomingStatus.Proposed, + totalCost: undefined, }); }); |