[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: sort coins by amount first
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: sort coins by amount first |
Date: |
Sun, 19 Jan 2020 21:17:44 +0100 |
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 a76219b8 sort coins by amount first
a76219b8 is described below
commit a76219b8debfc3f7e932ec9ad996248e431f437e
Author: Florian Dold <address@hidden>
AuthorDate: Sun Jan 19 21:17:39 2020 +0100
sort coins by amount first
---
src/operations/pay.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index c5a34418..b8a63cb1 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -185,10 +185,12 @@ export function selectPayCoins(
}
const coinPubs: string[] = [];
const coinContributions: AmountJson[] = [];
- // Sort by ascending deposit fee and denomPub if deposit fee is the same
+ // Sort by available amount (descending), deposit fee (ascending) and
+ // denomPub (ascending) if deposit fee is the same
// (to guarantee deterministic results)
acis.sort(
(o1, o2) =>
+ -Amounts.cmp(o1.availableAmount, o2.availableAmount) ||
Amounts.cmp(o1.feeDeposit, o2.feeDeposit) ||
strcmp(o1.denomPub, o2.denomPub),
);
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: sort coins by amount first,
gnunet <=