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

Conversation

Projects
None yet
2 participants
@almogdepaz
Copy link
Member

almogdepaz commented Jan 2, 2019

No description provided.

almogdepaz added some commits Jan 1, 2019

Merge branch 'develop' into orphanBlocks
# Conflicts:
#	sync/syncer.go
#	sync/syncer_test.go
Show resolved Hide resolved 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

almogdepaz added some commits Jan 3, 2019

pr fixes
changed map type to struct
Merge branch 'develop' into orphanBlocks
# Conflicts:
#	mesh/mesh.go
#	mesh/mesh_test.go
#	sync/syncer.go
#	sync/syncer_test.go
move uint32 []byte conversion to common
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

Collaborator

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

Collaborator

what do we do when we get an error here?

@almogdepaz almogdepaz merged commit a13eca6 into develop Jan 3, 2019

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