mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-08 11:53:16 +01:00
routing: add block cache to BitcoindFilteredChainView
This commit adds the block cache to the BitcoindFilteredChainView struct and wraps its GetBlock function so that block cache is used.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
_ "github.com/btcsuite/btcwallet/walletdb/bdb" // Required to register the boltdb walletdb implementation.
|
||||
|
||||
"github.com/lightninglabs/neutrino"
|
||||
"github.com/lightningnetwork/lnd/blockcache"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/channeldb/kvdb"
|
||||
)
|
||||
@@ -844,7 +845,11 @@ var interfaceImpls = []struct {
|
||||
cleanUp2()
|
||||
}
|
||||
|
||||
chainView := NewBitcoindFilteredChainView(chainConn)
|
||||
blockCache := blockcache.NewBlockCache(10000)
|
||||
|
||||
chainView := NewBitcoindFilteredChainView(
|
||||
chainConn, blockCache,
|
||||
)
|
||||
|
||||
return cleanUp3, chainView, nil
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user