mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01:00
chainntnfs: add block cache to BitcoindNotifier
This commit adds a blockcache pointer to BitcoindNotifier and wraps its GetBlock method so that the block cache is used.
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/btcsuite/btcwallet/chain"
|
||||
_ "github.com/btcsuite/btcwallet/walletdb/bdb" // Required to auto-register the boltdb walletdb implementation.
|
||||
"github.com/lightninglabs/neutrino"
|
||||
"github.com/lightningnetwork/lnd/blockcache"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs/bitcoindnotify"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs/btcdnotify"
|
||||
@@ -1930,6 +1931,8 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
|
||||
t.Fatalf("unable to create height hint cache: %v", err)
|
||||
}
|
||||
|
||||
blockCache := blockcache.NewBlockCache(10000)
|
||||
|
||||
var (
|
||||
cleanUp func()
|
||||
newNotifier func() (chainntnfs.TestChainNotifier, error)
|
||||
@@ -1944,7 +1947,7 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
|
||||
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
|
||||
return bitcoindnotify.New(
|
||||
bitcoindConn, chainntnfs.NetParams,
|
||||
hintCache, hintCache,
|
||||
hintCache, hintCache, blockCache,
|
||||
), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user