Skip to content

Commit

Permalink
Fix for the transactions
Browse files Browse the repository at this point in the history
Using explorer instead of richlist
  • Loading branch information
Exlo84 committed Jun 21, 2022
1 parent b68a9c9 commit b16e9b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion assets/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h2 style="color:white; margin-top: 15px">Etho Protocol Social Media</h2>
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://t.me/Ether_1')">Telegram</button>
</div>
<div class="column">
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://t.me/Ether1News')">News</button>
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('https://ethoprotocol.com/blog/')">News Blog</button>
</div>
<div class="column">
<button class="aboutbutton ui inverted blue button" type="button" onclick="require('electron').shell.openExternal('mailto:admin@ethoprotocol.com')">Email</button>
Expand Down
26 changes: 15 additions & 11 deletions renderer/transactions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {ipcRenderer} = require("electron");
const moment = require("moment");

class Transactions {
constructor() {
Expand Down Expand Up @@ -46,19 +47,22 @@ class Transactions {
lastBlock
]);

$.getJSON("https://richlist.ethoprotocol.com/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(),
fromaddr: element.fromaddr.toLowerCase(),
timestamp: element.timestamp,
toaddr: element.toaddr.toLowerCase(),
value: element.value
$.getJSON("https://explorer1.ethoprotocol.com/api?module=account&action=txlist&address=" + addressList[counter].toLowerCase(), function (result) {

if (result.result) {
result.result.forEach(element => {
if (element.from && element.to && startBlock <= parseInt(element.blockNumber) && lastBlock >= parseInt(element.blockNumber)) {
ipcRenderer.send("storeTransaction", {
block: element.blockNumber.toString(),
txhash: element.hash.toLowerCase(),
fromaddr: element.from.toLowerCase(),
timestamp: moment.unix(parseInt(element.timeStamp)).format("YYYY-MM-DD HH:mm:ss"),
toaddr: element.to.toLowerCase(),
value: element.value
});
}
});
}
});

// call the transaction sync for the next address
EthoTransactions.syncTransactionsForSingleAddress(addressList, counters, lastBlock, counter + 1);
Expand Down

0 comments on commit b16e9b2

Please sign in to comment.