! transactions fixes

This commit is contained in:
Taegus
2018-12-25 12:09:14 +01:00
parent 82e988a723
commit a32b746e4f
2 changed files with 8 additions and 2 deletions

View File

@@ -9,9 +9,15 @@ db.loadDatabase(function (err) {
// Now commands will be executed
});
// index the block field
db.ensureIndex({ fieldName: 'block' }, function (err) {
// If there was an error, err is not null
});
// index the txhash field
db.ensureIndex({ fieldName: 'txhash', unique: true }, function (err) {
// If there was an error, err is not null
});
ipcMain.on('storeTransaction', (event, arg) => {
db.update({ txhash: arg.txhash }, arg, { upsert: true }, function (err, numReplaced, upsert) {