chainntnfs: add block cache to BtcdNotifier

This commit adds gives BtcdNotifier access to the block cache and wraps
its GetBlock method so that it uses the block cache.
This commit is contained in:
Elle Mouton
2021-03-18 14:54:36 +02:00
parent 8a33fbf11a
commit a0f7bf8b2d
6 changed files with 40 additions and 10 deletions

View File

@@ -3205,8 +3205,9 @@ func TestLightningWallet(t *testing.T, targetBackEnd string) {
if err != nil {
t.Fatalf("unable to create height hint cache: %v", err)
}
blockCache := blockcache.NewBlockCache(10000)
chainNotifier, err := btcdnotify.New(
&rpcConfig, netParams, hintCache, hintCache,
&rpcConfig, netParams, hintCache, hintCache, blockCache,
)
if err != nil {
t.Fatalf("unable to create notifier: %v", err)