taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 00b25fa66a2263ac675b070c969295973101098d
parent 2cf33705c8ef95e04144b2a77cd4a79189136199
Author: Florian Dold <florian.dold@gmail.com>
Date:   Sun,  4 Jun 2017 20:25:28 +0200

check trust by key, not by URL

Diffstat:
Msrc/types.ts | 7+------
Msrc/wallet.ts | 6+++---
2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/types.ts b/src/types.ts @@ -154,14 +154,9 @@ export interface AuditorRecord { */ export interface ExchangeForCurrencyRecord { /** - * Priority for automatic selection when withdrawing. * FIXME: unused? */ - priority: number; - /** - * FIXME: unused? - */ - pinnedPub?: string; + exchangePub: string; /** * Base URL of the exchange. */ diff --git a/src/wallet.ts b/src/wallet.ts @@ -1158,7 +1158,7 @@ export class Wallet { } if (!isAudited && !isTrusted) { - currencyRecord.exchanges.push({baseUrl: req.exchange, priority: 0}); + currencyRecord.exchanges.push({baseUrl: req.exchange, exchangePub: exchangeInfo.masterPublicKey}); } await this.q() @@ -1445,14 +1445,14 @@ export class Wallet { const currencyRecord = await this.q().get(Stores.currencies, exchangeInfo.currency); if (currencyRecord) { for (const trustedExchange of currencyRecord.exchanges) { - if (trustedExchange.baseUrl === exchangeInfo.baseUrl) { + if (trustedExchange.exchangePub === exchangeInfo.masterPublicKey) { isTrusted = true; break; } } for (const trustedAuditor of currencyRecord.auditors) { for (const exchangeAuditor of exchangeInfo.auditors) { - if (trustedAuditor.baseUrl === exchangeAuditor.auditor_url) { + if (trustedAuditor.auditorPub === exchangeAuditor.auditor_pub) { isAudited = true; break; }