+ delete and re-sync transactions

+ add to address book from send screen
This commit is contained in:
Taegus
2018-12-28 10:26:32 +01:00
parent d33f90b738
commit 1c629801c4
7 changed files with 94 additions and 40 deletions

View File

@@ -17,7 +17,29 @@ $(document).on("render_settings", function() {
if (EthoTransactions.getIsSyncing()) {
EthoMainGUI.showGeneralError("Transactions sync is currently in progress");
} else {
// first disable keepInSync
EthoTransactions.disableKeepInSync();
// then delete the transactions data
var counters = EthoDatatabse.getCounters();
counters.transactions = 0;
EthoDatatabse.setCounters(counters);
ipcRenderer.sendSync('deleteTransactions', null);
// sync all the transactions to the current block
web3Local.eth.getBlock("latest", function(error, localBlock) {
if (error) {
EthoMainGUI.showGeneralError(error);
} else {
EthoTransactions.enableKeepInSync();
EthoTransactions.syncTransactionsForAllAddresses(localBlock.number);
iziToast.success({
title: 'Success',
message: 'Transactions are being resynced',
position: 'topRight',
timeout: 5000
});
}
});
}
}
});