Skip to content

refactor chain to be map of blocks, traverse top to bottom #88

@thepiwo

Description

@thepiwo
  • replace list in chain worker with map
  • reference blocks by hash in this map
  • keep head_block_hash list additionally to map in genserver state (should be a list because there could be multiple valid head blocks in the future)
  • to get list of blocks, traverse from latest, via prev_block_hash to the bottom
  • refactor block validation to have only block and chainstate as parameter. get the prev_block by hash from the chain, and the traverse the chain to get blocks for difficulty check

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions