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

Orphan blocks #395

Merged
merged 16 commits into from Jan 3, 2019
Merged

Orphan blocks #395

merged 16 commits into from Jan 3, 2019

Conversation

@almogdepaz
Copy link
Contributor

@almogdepaz almogdepaz commented Jan 2, 2019

No description provided.

almogdepaz added 11 commits Jan 1, 2019
# Conflicts:
#	sync/syncer.go
#	sync/syncer_test.go
mesh/block.go Outdated Show resolved Hide resolved
mesh/encode.go Outdated Show resolved Hide resolved
mesh/mesh.go Show resolved Hide resolved
mesh/mesh.go Show resolved Hide resolved
mesh/mesh.go Show resolved Hide resolved
almogdepaz added 4 commits Jan 3, 2019
changed map type to struct
# Conflicts:
#	mesh/mesh.go
#	mesh/mesh_test.go
#	sync/syncer.go
#	sync/syncer_test.go
update dependencies
m.tortoise.HandleLateBlock(block) //todo should be thread safe?
return nil
}

//todo better thread safety
func (m *mesh) handleOrphanBlocks(block *Block) {
m.orphanBlocks.Put(block.ID().ToBytes(), TRUE)

This comment has been minimized.

@antonlerner

antonlerner Jan 3, 2019
Member

lock mutex?

atomic.AddInt32(&m.orphanBlockCount, 1)
for b := range block.ViewEdges {
blockId := b.ToBytes()
if _, err := m.orphanBlocks.Get(blockId); err == nil {

This comment has been minimized.

@antonlerner

antonlerner Jan 3, 2019
Member

what do we do when we get an error here?

@almogdepaz almogdepaz merged commit a13eca6 into develop Jan 3, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@y0sher y0sher deleted the orphanBlocks branch Jan 14, 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