diff --git a/apis/candidates.js b/apis/candidates.js index 3d118c3f..c9c4cabd 100644 --- a/apis/candidates.js +++ b/apis/candidates.js @@ -630,6 +630,11 @@ router.get('/:candidate/:owner/getRewards', [ const candidate = req.params.candidate const owner = req.params.owner + + const latestBlockNumber = await web3.eth.getBlockNumber() + const latestCheckpoint = latestBlockNumber - (latestBlockNumber % parseInt(config.get('blockchain.epoch'))) + const currentEpoch = (parseInt(latestCheckpoint / config.get('blockchain.epoch')) + 1).toString() + let limit = (req.query.limit) ? parseInt(req.query.limit) : 100 const page = parseInt(req.query.page) || 1 let skip @@ -670,6 +675,10 @@ router.get('/:candidate/:owner/getRewards', [ if (!r.reward) { r.rewardTime = mn.epochCreatedAt || '' } + if (currentEpoch - r.epoch < 2) { + r.masternodeReward = '-' + r.signNumber = '-' + } return r }) } diff --git a/app/components/candidates/View.vue b/app/components/candidates/View.vue index 2707ef49..5be822ca 100644 --- a/app/components/candidates/View.vue +++ b/app/components/candidates/View.vue @@ -262,7 +262,8 @@