mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-22 07:08:14 +02:00
lnd+channeldb: pre-allocate cache size
To avoid the channel map needing to be re-grown while we fill the cache initially, we might as well pre-allocate it with a somewhat sane value to decrease the number of grow events.
This commit is contained in:
@@ -290,7 +290,7 @@ func CreateWithBackend(backend kvdb.Backend, modifiers ...OptionModifier) (*DB,
|
||||
var err error
|
||||
chanDB.graph, err = NewChannelGraph(
|
||||
backend, opts.RejectCacheSize, opts.ChannelCacheSize,
|
||||
opts.BatchCommitInterval,
|
||||
opts.BatchCommitInterval, opts.PreAllocCacheNumNodes,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user