* redesigned sync, so no external node is needed

+ allow only once instance of the wallet
+ store txhash and use it as single ID for transactions
This commit is contained in:
Taegus
2018-12-24 21:44:41 +01:00
parent 7d6ba1c1f8
commit 82e988a723
7 changed files with 136 additions and 124 deletions

View File

@@ -14,7 +14,7 @@ db.ensureIndex({ fieldName: 'block' }, function (err) {
});
ipcMain.on('storeTransaction', (event, arg) => {
db.update({ block: arg.block, fromaddr: arg.fromaddr, toaddr: arg.toaddr }, arg, { upsert: true }, function (err, numReplaced, upsert) {
db.update({ txhash: arg.txhash }, arg, { upsert: true }, function (err, numReplaced, upsert) {
// do nothing for now
});
});
@@ -29,8 +29,7 @@ ipcMain.on('getTransactions', (event, arg) => {
docs[i].timestamp,
docs[i].fromaddr,
docs[i].toaddr,
docs[i].value,
docs[i].confirmed || 1
docs[i].value
]);
}

View File

@@ -53,8 +53,8 @@ class Geth {
this.gethProcess.stdout.on('data', function(data) {
EthoGeth._writeLog(data.toString() + '\n');
});
} catch (e) {
dialog.showErrorBox("Error starting application", e);
} catch (err) {
dialog.showErrorBox("Error starting application", err.message);
app.quit();
}
}