! transactions fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user