diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-17 18:59:27 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-17 18:59:27 +0100 |
commit | 0f607edbb2146ff82f9dcd71a1fe2905630c0d58 (patch) | |
tree | 6fdaec33ddc28026efbfa2dccd21272d58f00a57 /extension | |
parent | ade05920dc3c877c89149fcfa9fb4246b50216ea (diff) | |
download | wallet-core-0f607edbb2146ff82f9dcd71a1fe2905630c0d58.tar.xz |
debug
Diffstat (limited to 'extension')
-rw-r--r-- | extension/lib/wallet/wallet.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/extension/lib/wallet/wallet.ts b/extension/lib/wallet/wallet.ts index fe3148c9b..608876abf 100644 --- a/extension/lib/wallet/wallet.ts +++ b/extension/lib/wallet/wallet.ts @@ -442,6 +442,8 @@ export class Wallet { private getPossibleMintCoins(paymentAmount: AmountJson, depositFeeLimit: AmountJson, allowedMints: MintInfo[]): Promise<MintCoins> { + // Mapping from mint base URL to list of coins together with their + // denomination let m: MintCoins = {}; function storeMintCoin(mc) { @@ -472,6 +474,16 @@ export class Wallet { return Promise.all(ps).then(() => { let ret: MintCoins = {}; + if (Object.keys(m).length == 0) { + console.log("not suitable mints found"); + } + + console.dir(m); + + // We try to find the first mint where we have + // enough coins to cover the paymentAmount with fees + // under depositFeeLimit + nextMint: for (let key in m) { let coins = m[key].map((x) => ({ @@ -495,6 +507,8 @@ export class Wallet { accFee.add(coinFee); accAmount.add(coinAmount); if (accFee.cmp(maxFee) >= 0) { + // FIXME: if the fees are too high, we have + // to cover them ourselves .... console.log("too much fees"); continue nextMint; } |