From bf86d03f842b52bd9e0fee45509f0ccb3bda92db Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Fri, 20 Aug 2021 11:56:16 -0400 Subject: [PATCH] [lbry] claimtrie: init blockRepo with empty merkle hash at block 0 --- claimtrie/claimtrie.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/claimtrie/claimtrie.go b/claimtrie/claimtrie.go index 4cddb06f..5cdd44e1 100644 --- a/claimtrie/claimtrie.go +++ b/claimtrie/claimtrie.go @@ -64,6 +64,10 @@ func New(cfg config.Config) (*ClaimTrie, error) { return nil, errors.Wrap(err, "creating block repo") } cleanups = append(cleanups, blockRepo.Close) + err = blockRepo.Set(0, merkletrie.EmptyTrieHash) + if err != nil { + return nil, errors.Wrap(err, "setting block repo genesis") + } dbPath = filepath.Join(dataDir, cfg.TemporalRepoPebble.Path) temporalRepo, err := temporalrepo.NewPebble(dbPath)