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

Projects
None yet
2 participants
@antonlerner
Copy link
Member

antonlerner commented Apr 11, 2019

…for a miner in the same layer

antonlerner added some commits Apr 11, 2019

@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.

Copy link
@y0sher

y0sher Apr 11, 2019

Collaborator

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.

Copy link
@y0sher

y0sher Apr 11, 2019

Collaborator

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.

Copy link
@y0sher

y0sher Apr 11, 2019

Collaborator

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

@y0sher

y0sher approved these changes Apr 11, 2019

antonlerner added some commits Apr 11, 2019

fmt

@antonlerner antonlerner merged commit 29b2786 into develop Apr 12, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.