! fixed bug in importing single account to the wallet
! fixed bug when smart contract transactions were causing problems
This commit is contained in:
@@ -42,11 +42,11 @@ class Accounts {
|
||||
var extName = path.extname(accountsFile).toUpperCase();
|
||||
const accPath = this.getKeyStoreLocation();
|
||||
|
||||
if (extName = '.ZIP') {
|
||||
if (extName == '.ZIP') {
|
||||
var zip = new admZip(accountsFile);
|
||||
zip.extractAllTo(accPath, true);
|
||||
return { success: true, text: "Accounts ware successfully imported."};
|
||||
} else if (extName = '.JSON') {
|
||||
} else {
|
||||
fs.copyFile(accountsFile, path.join(accPath, path.basename(accountsFile)), (err) => {
|
||||
if (err) {
|
||||
return { success: false, text: err};
|
||||
@@ -54,8 +54,6 @@ class Accounts {
|
||||
return { success: true, text: "Account was successfully imported."};
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return { success: false, text: "This is not a valid account file or arhive!"};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +80,10 @@ ipcMain.on('importAccounts', (event, arg) => {
|
||||
{
|
||||
"name": "json",
|
||||
"extensions": ["json"]
|
||||
},
|
||||
{
|
||||
"name": "All",
|
||||
"extensions": ["*.*"]
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -89,7 +91,7 @@ ipcMain.on('importAccounts', (event, arg) => {
|
||||
if (openPath) {
|
||||
event.returnValue = EthoAccounts.importAccounts(openPath[0]);
|
||||
} else {
|
||||
event.returnValue = false;
|
||||
event.returnValue = {};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ class Transactions {
|
||||
|
||||
$.getJSON("https://richlist.ether1.org/transactions_list.php" + params, function( result ) {
|
||||
result.data.forEach(element => {
|
||||
if (element.fromaddr && element.toaddr) {
|
||||
ipcRenderer.send('storeTransaction', {
|
||||
block: element.block.toString(),
|
||||
txhash: element.txhash.toLowerCase(),
|
||||
@@ -52,6 +53,7 @@ class Transactions {
|
||||
toaddr: element.toaddr.toLowerCase(),
|
||||
value: element.value
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// call the transaction sync for the next address
|
||||
@@ -128,6 +130,7 @@ class Transactions {
|
||||
function(data) {
|
||||
if (data.transactions) {
|
||||
data.transactions.forEach(element => {
|
||||
if (element.from && element.to) {
|
||||
if ((EthoWallets.getAddressExists(element.from)) || (EthoWallets.getAddressExists(element.to))) {
|
||||
var Transaction = {
|
||||
block: element.blockNumber.toString(),
|
||||
@@ -155,6 +158,7 @@ class Transactions {
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ $(document).on("render_wallets", function() {
|
||||
position: 'topRight',
|
||||
timeout: 2000
|
||||
});
|
||||
} else {
|
||||
} else if (ImportResult.success == false) {
|
||||
EthoMainGUI.showGeneralError(ImportResult.text);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user