@@ -30,7 +30,7 @@ consumer.task = async function (job, done) {
30
30
let hash = candidate . candidate . toLowerCase ( )
31
31
32
32
console . info ( 'process candidate' , hash )
33
- let txCount = await db . Tx . countDocuments ( { $or : [ { from : hash } , { to : hash } ] } )
33
+ let txCount = await db . Tx . countDocuments ( { $or : [ { from : hash } , { to : hash } ] , isPending : false } )
34
34
let minedBlock = await db . Block . countDocuments ( { signer : hash } )
35
35
let rewardCount = await db . Reward . countDocuments ( { address : hash } )
36
36
let logCount = await db . Log . countDocuments ( { address : hash } )
@@ -42,7 +42,7 @@ consumer.task = async function (job, done) {
42
42
} , { upsert : true } )
43
43
44
44
let owner = candidate . owner . toLowerCase ( )
45
- let txCountOwner = await db . Tx . countDocuments ( { $or : [ { from : owner } , { to : owner } ] } )
45
+ let txCountOwner = await db . Tx . countDocuments ( { $or : [ { from : owner } , { to : owner } ] , isPending : false } )
46
46
let minedBlockOwner = await db . Block . countDocuments ( { signer : owner } )
47
47
let rewardCountOwner = await db . Reward . countDocuments ( { address : owner } )
48
48
let logCountOwner = await db . Log . countDocuments ( { address : owner } )
@@ -59,9 +59,9 @@ consumer.task = async function (job, done) {
59
59
console . info ( 'there are %s contract accounts' , accounts . length )
60
60
let map2 = accounts . map ( async ( acc ) => {
61
61
let hash = acc . hash . toLowerCase ( )
62
- let txCount = await db . Tx . countDocuments ( { from : hash } )
63
- txCount += await db . Tx . countDocuments ( { to : hash } )
64
- txCount += await db . Tx . countDocuments ( { contractAddress : hash } )
62
+ let txCount = await db . Tx . countDocuments ( { from : hash , isPending : false } )
63
+ txCount += await db . Tx . countDocuments ( { to : hash , isPending : false } )
64
+ txCount += await db . Tx . countDocuments ( { contractAddress : hash , isPending : false } )
65
65
let logCount = await db . Log . countDocuments ( { address : hash } )
66
66
await db . SpecialAccount . updateOne ( { hash : hash } , {
67
67
transactionCount : txCount ,
0 commit comments