From f394fd082f30452b828aa8c6254c576e460c4606 Mon Sep 17 00:00:00 2001 From: bethnull Date: Mon, 5 Sep 2016 13:18:43 +0200 Subject: [PATCH 1/2] Fixed _setDataPath when the bitcore node is using the regtest network. Comparing this.node.network against Networks.livenet and Networks.testnet works when the bitcore node is using the livenet and testnet networks, however when using the regtest network the extra field regTestEnabled present in this.node.network makes comparing it with Networks.testnet to fail. this.node.network: Network { name: 'testnet', alias: 'regtest', pubkeyhash: 111, privatekey: 239, scripthash: 196, xpubkey: 70617039, xprivkey: 70615956, port: [Getter], networkMagic: [Getter], dnsSeeds: [Getter], regtestEnabled: true } Networks.testnet: Network { name: 'testnet', alias: 'regtest', pubkeyhash: 111, privatekey: 239, scripthash: 196, xpubkey: 70617039, xprivkey: 70615956, port: [Getter], networkMagic: [Getter], dnsSeeds: [Getter] } --- stampingservice/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stampingservice/index.js b/stampingservice/index.js index 9bf59e7..d953f9c 100644 --- a/stampingservice/index.js +++ b/stampingservice/index.js @@ -63,9 +63,9 @@ StampingService.PREFIX = String.fromCharCode(0xff); StampingService.prototype._setDataPath = function() { $.checkState(this.node.services.bitcoind.spawn.datadir, 'bitcoind is expected to have a "spawn.datadir" property'); var datadir = this.node.services.bitcoind.spawn.datadir; - if (this.node.network === Networks.livenet) { + if (this.node.network.name === Networks.livenet.name) { this.dataPath = datadir + '/bitcore-stamps.db'; - } else if (this.node.network === Networks.testnet) { + } else if (this.node.network.name === Networks.testnet.name) { if (this.node.network.regtestEnabled) { this.dataPath = datadir + '/regtest/bitcore-stamps.db'; } else { From 401e0fd0c6d46457a4206d78d32ee117a8765fda Mon Sep 17 00:00:00 2001 From: bethnull Date: Mon, 5 Sep 2016 14:24:10 +0200 Subject: [PATCH 2/2] Fixed some bugs related with newer electron versions. app, BrowserWindow and crash-reporter are now fetched via require('electron').app and require('electron').BrowserWindow and require('electron').crashReporter respectively. crashReporter also needs a config object in its start method. --- main.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 9405f7f..f865240 100644 --- a/main.js +++ b/main.js @@ -1,9 +1,14 @@ 'use strict'; -var app = require('app'); // Module to control application life. -var BrowserWindow = require('browser-window'); // Module to create native browser window. +var app = require('electron').app; // Module to control application life. +var BrowserWindow = require('electron').BrowserWindow; // Module to create native browser window. // Report crashes to our server. -require('crash-reporter').start(); +require('electron').crashReporter.start({ + productName: 'YourName', + companyName: 'YourCompany', + submitURL: 'https://change-that-to-your-company-domain.com/url-to-submit', + autoSubmit: true +}); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -25,7 +30,7 @@ app.on('ready', function() { mainWindow = new BrowserWindow({width: 725, height: 680, resizable: false}); // and load the index.html of the app. - mainWindow.loadUrl('file://' + __dirname + '/index.html'); + mainWindow.loadURL('file://' + __dirname + '/index.html'); // Open the DevTools. //mainWindow.openDevTools();