aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-06-04 20:25:28 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-06-04 20:25:28 +0200
commit00b25fa66a2263ac675b070c969295973101098d (patch)
treeb030c80a4dc075fe5236a50b7cbf3561434258af
parent2cf33705c8ef95e04144b2a77cd4a79189136199 (diff)
check trust by key, not by URL
-rw-r--r--src/types.ts7
-rw-r--r--src/wallet.ts6
2 files changed, 4 insertions, 9 deletions
diff --git a/src/types.ts b/src/types.ts
index 9a7a79aca..68fde2690 100644
--- 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
index 2f5fa294e..0d4a8e0dc 100644
--- 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;
}