Skip to content

Commit 72d7b3a

Browse files
syncingBlockAndTxStatAllDates
1 parent 12a8fd8 commit 72d7b3a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

expressApp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ expressApp.get('/syncing', async (req, res) => {
3030
//await syncing.deleteBlackTxsAndAddress();
3131
await syncing.calculatePeers();
3232
//syncing.syncingTxWaitDoingAction(10);
33-
//await syncing.syncingBlockAndTxStatAllDates(80);
33+
//await syncing.syncingBlockAndTxStatAllDates(20);
3434
//await syncing.syncingBlockMissing();
3535
//35753 43355
3636
//await syncing.syncingBlockPromiseAll(30);
@@ -115,11 +115,11 @@ cron.schedule('*/10 * * * *', () => {
115115
syncing.deleteBlackTxsAndAddress();
116116
syncing.calculatePeers();
117117
syncing.syncingTxWaitDoingAction(10);
118-
syncing.syncingBlockAndTxStatAllDates(80);
119118
});
120119

121120
cron.schedule('1 1 * * *', () => {
122121
syncing.resetTx404();
122+
syncing.syncingBlockAndTxStatAllDates(80);
123123
console.log('schedule syncingTxParseBundle Task Begin !!!');
124124
if (global.gc) {
125125
console.log('Manual garbage collection');

src/syncing.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,8 @@
777777
insertAddress.finalize();
778778
//Update Address
779779
const AddressBalanceTarget = await axios.get(NodeApi + "/wallet/" + TxInfor.target + "/balance", {}).then((res)=>{return res.data}).catch(() => {});
780-
log("TxInfor.target", TxInfor.target)
781-
log("AddressBalanceTarget", AddressBalanceTarget/1000000000000)
780+
console.log("TxInfor.target", TxInfor.target)
781+
console.log("AddressBalanceTarget", AddressBalanceTarget/1000000000000)
782782
const updateAddress = db.prepare('update address set lastblock = ?, timestamp = ?, balance = ? where id = ?');
783783
updateAddress.run(BlockInfor.height, BlockInfor.timestamp, AddressBalanceTarget, TxInfor.target);
784784
updateAddress.finalize();
@@ -1780,11 +1780,11 @@
17801780
db.get(
17811781
"SELECT SUM(block_size / 1048576) AS block_size, " +
17821782
"SUM(mining_time) AS mining_time, " +
1783-
"SUM(reward / 1000000000000) AS reward, " +
1783+
"SUM(reward) / 1000000000000 AS reward, " +
17841784
"SUM(txs_length) AS txs_length, " +
17851785
"MAX(weave_size / 1048576) AS weave_size, " +
17861786
"MAX(cumulative_diff / 1024) AS cumulative_diff, " +
1787-
"SUM(reward_pool / 1000000000000) AS reward_pool, " +
1787+
"SUM(reward_pool) / 1000000000000 AS reward_pool, " +
17881788
"COUNT(*) AS block_count " +
17891789
"FROM block WHERE block_date = ?",
17901790
[filterString(block_date)],
@@ -1797,7 +1797,7 @@
17971797
}
17981798
);
17991799
});
1800-
//log("BlockStat", BlockStat)
1800+
console.log("BlockStat", block_date, BlockStat)
18011801
if(BlockStat && BlockStat.reward) {
18021802

18031803
const TxStat = await new Promise((resolve, reject) => {
@@ -2003,7 +2003,7 @@
20032003
resolve(null);
20042004
return;
20052005
}
2006-
db.all("SELECT reward_addr as id, reward_addr, sum(reward / 1000000000000) as reward_amount, count(*) as reward_number FROM block WHERE timestamp >= strftime('%s', 'now', '-24 hours') group by reward_addr order by reward_amount desc", (err, result) => {
2006+
db.all("SELECT reward_addr as id, reward_addr, sum(reward) / 1000000000000 as reward_amount, count(*) as reward_number FROM block WHERE timestamp >= strftime('%s', 'now', '-24 hours') group by reward_addr order by reward_amount desc", (err, result) => {
20072007
if (err) {
20082008
reject(err);
20092009
} else {

0 commit comments

Comments
 (0)