routing: add block cache to CfFilteredChainView

This commit adds the block cache to the CfFilteredChainView struct
and wraps its GetBlock function so that block cache mutex map is used
when the call to neutrino's GetBlock function is called.
This commit is contained in:
Elle Mouton
2021-03-30 10:04:30 +02:00
parent 432b1f0588
commit 6ad5781bf1
3 changed files with 32 additions and 4 deletions

View File

@@ -895,7 +895,11 @@ var interfaceImpls = []struct {
os.RemoveAll(spvDir)
}
chainView, err := NewCfFilteredChainView(spvNode)
blockCache := blockcache.NewBlockCache(10000)
chainView, err := NewCfFilteredChainView(
spvNode, blockCache,
)
if err != nil {
return nil, nil, err
}