From 7c9d9555dbd12df50a986181f6112f591220b9f5 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 23 Sep 2018 09:28:32 -0400 Subject: [PATCH] call electrum-client's initElectrum function --- app/api/electrumApi.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/api/electrumApi.js b/app/api/electrumApi.js index 2f4cf8f..80db745 100644 --- a/app/api/electrumApi.js +++ b/app/api/electrumApi.js @@ -18,12 +18,10 @@ function connectToServer(host, port) { console.log("Connecting to ElectrumX Server: " + host + ":" + port); var electrumClient = new ElectrumClient(port, host, 'tls'); - electrumClient.connect().then(function() { - electrumClient.server_version("btc-rpc-explorer-1.1", "1.2").then(function(res) { - console.log("Connected to ElectrumX Server: " + host + ":" + port + ", versions: " + res); + electrumClient.initElectrum({client:"btc-rpc-explorer-v1.1", version:"1.2"}).then(function(res) { + console.log("Connected to ElectrumX Server: " + host + ":" + port + ", versions: " + res); - electrumClients.push(electrumClient); - }); + electrumClients.push(electrumClient); }); }