+ transaction details with explorer redirection

+ sorting and floating header for wallets and address book
+ detect geth crash and notify the user
This commit is contained in:
Taegus
2019-03-05 18:54:29 +01:00
parent 0552dcdcba
commit 35c1eb5472
10 changed files with 366 additions and 251 deletions

View File

@@ -58,6 +58,7 @@ ipcMain.on("getTransactions", (event, arg) => {
ResultData.push([
docs[i].block,
docs[i].timestamp,
docs[i].txhash,
docs[i].fromaddr,
docs[i].toaddr,
docs[i].value

View File

@@ -7,8 +7,9 @@ const os = require("os");
class Geth {
constructor() {
this.isRunning = false;
this.gethProcess = null;
this.logGethEvents = false;
this.logGethEvents = true;
// create the user data dir (needed for MacOS)
if (!fs.existsSync(app.getPath("userData"))) {
fs.mkdirSync(app.getPath("userData"));
@@ -48,6 +49,7 @@ class Geth {
startGeth() {
// get the path of get and execute the child process
try {
this.isRunning = true;
const gethPath = path.join(this.binaries, "geth");
this.gethProcess = child_process.spawn(gethPath, [
"--ws",
@@ -69,6 +71,12 @@ class Geth {
dialog.showErrorBox("Error starting application", "Geth failed to start!");
app.quit();
});
this.gethProcess.on("close", function (err) {
if (this.isRunning) {
dialog.showErrorBox("Error running the node", "The node stoped working. Wallet will close!");
app.quit();
}
});
this.gethProcess.stderr.on("data", function (data) {
EthoGeth._writeLog(data.toString() + "\n");
});
@@ -83,6 +91,8 @@ class Geth {
}
stopGeth() {
this.isRunning = false;
if (os.type() == "Windows_NT") {
const gethWrapePath = path.join(this.binaries, "WrapGeth.exe");
child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]);

View File

@@ -162,7 +162,7 @@ if (process.platform === "darwin") {
}
ipcMain.on("openURL", (event, arg) => {
shell.openExternal("https://github.com/taeguscromis/Ether1DesktopWallet/issues");
shell.openExternal(arg);
});
const menu = Menu.buildFromTemplate(template);