Skip to content

Commit

Permalink
Fix coin supply counter to reduce work and tax subsidy based on voters
Browse files Browse the repository at this point in the history
The first pass for the getCoinSupply command did not accurately reduce
the work and tax subsidies based on the number of voters. So the
coinsupply was slightly high due to blocks that had less than 5 voters
not being properly reduced to match the proper total block reward. Looks
like this reduces current coin supply count by roughly 1507 DCR
  • Loading branch information
alexlyp committed Feb 24, 2016
1 parent f001389 commit aa21c12
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,9 @@ func handleGetCoinSupply(s *rpcServer, cmd interface{}, closeChan <-chan struct{
if int64(i) < params.StakeValidationHeight {
supply += (work + tax)
} else {
// Make sure to reduce work and tax subsidy based on number of voters
work = work * voters / int64(params.TicketsPerBlock)
tax = tax * voters / int64(params.TicketsPerBlock)
supply += (work + stake + tax)
}
}
Expand Down

0 comments on commit aa21c12

Please sign in to comment.