From 997c061b1a25ced69776669e647372fb896e37f8 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 10 Sep 2014 12:36:33 -0700 Subject: [PATCH] settings: change Insight.js opts --- config.js | 2 +- js/models/blockchain/Insight.js | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config.js b/config.js index 39fa2cbbb..a22baad87 100644 --- a/config.js +++ b/config.js @@ -19,7 +19,7 @@ var defaultConfig = { url: 'https://test-insight.bitpay.com:443' }, livenet: { - url: 'https:insight.bitpay.com:443' + url: 'https://insight.bitpay.com:443' }, }, diff --git a/js/models/blockchain/Insight.js b/js/models/blockchain/Insight.js index b4d928c4c..aa53fb560 100644 --- a/js/models/blockchain/Insight.js +++ b/js/models/blockchain/Insight.js @@ -15,9 +15,7 @@ var preconditions = require('preconditions').singleton(); subscribing to transactions on adressess and blocks. Opts: - - host - - port - - schema + - url - reconnection (optional) - reconnectionDelay (optional) @@ -31,19 +29,18 @@ var preconditions = require('preconditions').singleton(); var Insight = function(opts) { preconditions.checkArgument(opts) .shouldBeObject(opts) - .checkArgument(opts.host) - .checkArgument(opts.port) - .checkArgument(opts.schema); + .checkArgument(opts.url) this.status = this.STATUS.DISCONNECTED; this.subscribed = {}; this.listeningBlocks = false; - this.url = opts.schema + '://' + opts.host + ':' + opts.port; + this.url = opts.url; + alert(this.url); this.opts = { 'reconnection': opts.reconnection || true, 'reconnectionDelay': opts.reconnectionDelay || 1000, - 'secure': opts.schema === 'https' + 'secure': opts.url.indexOf('https') > -1 }; this.socket = this.getSocket();