Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed rewards to take id from atx, added support for multiple blocks … #808

Merged
merged 5 commits into from Apr 12, 2019

Conversation

antonlerner
Copy link
Contributor

…for a miner in the same layer

mesh/mesh.go Outdated
@@ -376,20 +377,21 @@ func (m *Mesh) AccumulateRewards(rewardLayer types.LayerID, params Config) {
return
}

ids := make(map[string]struct{})
uq := make(map[string]struct{})
var ids []string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you know the size of l.Blocks you can initialize it and insert them by index

tp.globalState.AddBalance(address.HexToAddress(minerId), diminishedReward)
underQuota[minerId] = underQuota[minerId] - 1
} else {
tp.globalState.AddBalance(address.HexToAddress(minerId), bonusReward)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you cloud delete the map entry when underQuota[minerId] goes down to 0 and get rid of this `else and line, right ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because then ok will be false after it gone done to 0

@antonlerner antonlerner merged commit 29b2786 into develop Apr 12, 2019
@y0sher y0sher deleted the atx_reward branch September 10, 2019 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants