gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: tx ordering


From: gnunet
Subject: [taler-wallet-core] branch master updated: tx ordering
Date: Fri, 15 May 2020 20:23:03 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new ff505265 tx ordering
ff505265 is described below

commit ff50526560880ef070f1f6ec5a0a7eb4ae3fee2e
Author: Florian Dold <address@hidden>
AuthorDate: Fri May 15 23:52:58 2020 +0530

    tx ordering
---
 src/operations/transactions.ts | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/operations/transactions.ts b/src/operations/transactions.ts
index f016fb8c..9a3d48bb 100644
--- a/src/operations/transactions.ts
+++ b/src/operations/transactions.ts
@@ -18,7 +18,12 @@
  * Imports.
  */
 import { InternalWalletState } from "./state";
-import { Stores, ReserveRecordStatus, PurchaseRecord, WithdrawalSourceType } 
from "../types/dbTypes";
+import {
+  Stores,
+  ReserveRecordStatus,
+  PurchaseRecord,
+  WithdrawalSourceType,
+} from "../types/dbTypes";
 import { Amounts, AmountJson } from "../util/amounts";
 import { timestampCmp } from "../util/time";
 import {
@@ -299,7 +304,11 @@ export async function getTransactions(
     },
   );
 
-  transactions.sort((h1, h2) => timestampCmp(h1.timestamp, h2.timestamp));
+  const txPending = transactions.filter((x) => x.pending);
+  const txNotPending = transactions.filter((x) => !x.pending);
+
+  txPending.sort((h1, h2) => timestampCmp(h1.timestamp, h2.timestamp));
+  txNotPending.sort((h1, h2) => timestampCmp(h1.timestamp, h2.timestamp));
 
-  return { transactions };
+  return { transactions: [...txPending, ...txNotPending] };
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]