[lbry] claimtrie: init blockRepo with empty merkle hash at block 0

This commit is contained in:
Roy Lee 2021-08-20 11:56:16 -04:00
parent d2f8ad7657
commit bf86d03f84

View file

@ -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)