diff options
| author | Florian Dold <florian.dold@gmail.com> | 2015-12-17 23:34:39 +0100 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2015-12-17 23:34:39 +0100 |
| commit | 0d5c37a49e688503dc2933d379c68541dd432248 (patch) | |
| tree | b2218c700c7856286f64aab6827bc1a82c052e68 /extension/background/wallet.js | |
| parent | 38c947d7712d77070ca521b4718032fb31c0f108 (diff) | |
Fix some payment bugs.
It still doesn't work, some of the emscripten interface stuff
still needs to be finished.
Diffstat (limited to 'extension/background/wallet.js')
| -rw-r--r-- | extension/background/wallet.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extension/background/wallet.js b/extension/background/wallet.js index f915187ab..422e60ca5 100644 --- a/extension/background/wallet.js +++ b/extension/background/wallet.js @@ -61,7 +61,7 @@ function signDeposit(db, offer, cds) { * @param db * @param paymentAmount * @param depositFeeLimit - * @param mintKeys + * @param allowedMints */ function getPossibleMintCoins(db, paymentAmount, depositFeeLimit, allowedMints) { return new Promise((resolve, reject) => { @@ -83,10 +83,14 @@ function getPossibleMintCoins(db, paymentAmount, depositFeeLimit, allowedMints) if (!cursor) { return; } + let value = cursor.value; let cd = { coin: cursor.value, - denom: mint.keys.denoms[cursor.value.denomPub] + denom: mint.keys.denoms.find((e) => e.denom_pub === value.denomPub) }; + if (!cd.denom) { + throw Error("denom not found"); + } let x = m[mint.baseUrl]; if (!x) { m[mint.baseUrl] = [cd]; @@ -94,6 +98,7 @@ function getPossibleMintCoins(db, paymentAmount, depositFeeLimit, allowedMints) else { x.push(cd); } + cursor.continue(); }; }; } @@ -278,7 +283,7 @@ function withdrawPrepare(db, denom, reserve) { coinPub: coinPub.toCrock(), coinPriv: coinPriv.toCrock(), denomPub: denomPub.encode().toCrock(), - mintBaseUrl: reserve.mintBaseUrl, + mintBaseUrl: reserve.mint_base_url, withdrawSig: sig.toCrock(), coinEv: ev.toCrock(), coinValue: denom.value @@ -330,7 +335,8 @@ function withdrawExecute(db, pc) { coinPriv: pc.coinPriv, denomPub: pc.denomPub, denomSig: denomSig.encode().toCrock(), - currentAmount: pc.coinValue + currentAmount: pc.coinValue, + mintBaseUrl: pc.mintBaseUrl, }; console.log("unblinded coin"); resolve(coin); |
