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
Member

@antonlerner antonlerner commented Apr 11, 2019

…for a miner in the same layer

@antonlerner antonlerner requested review from noamnelke, zalmen and y0sher Apr 11, 2019
@@ -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

This comment has been minimized.

@y0sher

y0sher Apr 11, 2019
Contributor

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)

This comment has been minimized.

@y0sher

y0sher Apr 11, 2019
Contributor

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

This comment has been minimized.

@y0sher

y0sher Apr 11, 2019
Contributor

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

@y0sher
y0sher approved these changes Apr 11, 2019
@antonlerner antonlerner merged commit 29b2786 into develop Apr 12, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@y0sher y0sher deleted the atx_reward branch Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants