fix(chainwatch): Consider win_count in top_miner_by_base_reward view

This commit is contained in:
Mike Greenberg 2020-07-24 16:19:22 -04:00
parent 718dd26043
commit c6e0a69bbc

View File

@ -24,7 +24,7 @@ func setupTopMinerByBaseRewardSchema(ctx context.Context, db *sql.DB) error {
with total_rewards_by_miner as (
select
b.miner,
sum(bbr.base_block_reward) as total_reward
sum(bbr.base_block_reward * b.win_count) as total_reward
from blocks b
inner join base_block_rewards bbr on b.parentstateroot = bbr.state_root
group by 1