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 committed 2021-04-28 09:46:11 +02:00
1 parent 432b1f0588
commit 6ad5781bf1
3 files changed
+32 -4

No files matched your search

+3 -1
View File
@@ -319,7 +319,9 @@ func NewChainControl(cfg *Config, blockCache *blockcache.BlockCache) (
cc.ChainNotifier = neutrinonotify.New(
cfg.NeutrinoCS, hintCache, hintCache,
)
cc.ChainView, err = chainview.NewCfFilteredChainView(cfg.NeutrinoCS)
cc.ChainView, err = chainview.NewCfFilteredChainView(
cfg.NeutrinoCS, blockCache,
)
if err != nil {
return nil, nil, err
}