diff options
author | Florian Dold <florian@dold.me> | 2023-04-13 15:58:38 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-04-13 15:58:38 +0200 |
commit | b567ba4668a5ac034e7227f53b5290195303980c (patch) | |
tree | d98ea3061895ba222add5f0060a6781c1ea308d9 /packages/taler-wallet-core/src | |
parent | b96464fe09605e829dcd5715c69668e64c5454b3 (diff) | |
download | wallet-core-b567ba4668a5ac034e7227f53b5290195303980c.tar.xz |
wallet-core: work around missing timestamp in legacy transaction
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 02c726449..3ace5bf71 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -525,7 +525,8 @@ function buildTransactionForPeerPullCredit( ? ExtendedStatus.Done : ExtendedStatus.Pending, pending: !wsr.timestampFinish, - timestamp: pullCredit.mergeTimestamp, + // Old transactions don't have it! + timestamp: pullCredit.mergeTimestamp ?? TalerProtocolTimestamp.now(), info: { expiration: wsr.wgInfo.contractTerms.purse_expiration, summary: wsr.wgInfo.contractTerms.summary, @@ -558,7 +559,8 @@ function buildTransactionForPeerPullCredit( exchangeBaseUrl: pullCredit.exchangeBaseUrl, extendedStatus: ExtendedStatus.Pending, pending: true, - timestamp: pullCredit.mergeTimestamp, + // Old transactions don't have it! + timestamp: pullCredit.mergeTimestamp ?? TalerProtocolTimestamp.now(), info: { expiration: peerContractTerms.purse_expiration, summary: peerContractTerms.summary, @@ -1387,6 +1389,9 @@ export async function getTransactions( if (!tx.amountRaw) { logger.warn(`missing amountRaw in ${j2s(tx)}`); } + if (!tx.timestamp) { + logger.warn(`missing timestamp in ${j2s(tx)}`); + } } const txPending = transactions.filter((x) => x.pending); |