blockstore: fix race conditions when loading data (#5382)

Fixes #5377 and comments in #4588 (review).
This commit is contained in:
Erik Grinaker
2020-09-23 08:13:43 +02:00
committed by GitHub
parent 3502901dd8
commit 58b4deca86
8 changed files with 67 additions and 16 deletions

View File

@@ -122,6 +122,7 @@ type mockBlockStore struct {
func (mockBlockStore) Base() int64 { return 1 }
func (store mockBlockStore) Height() int64 { return store.height }
func (store mockBlockStore) Size() int64 { return store.height }
func (mockBlockStore) LoadBaseMeta() *types.BlockMeta { return nil }
func (mockBlockStore) LoadBlockMeta(height int64) *types.BlockMeta { return nil }
func (mockBlockStore) LoadBlock(height int64) *types.Block { return nil }
func (mockBlockStore) LoadBlockByHash(hash []byte) *types.Block { return nil }