mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
Merge pull request #3278 from Crypt-iQ/bbolt_options_0707
channeldb: specify freelist bbolt options by default
This commit is contained in:
@@ -63,7 +63,14 @@ func createDBIfNotExist(dbPath, name string) (*bbolt.DB, bool, error) {
|
||||
}
|
||||
}
|
||||
|
||||
bdb, err := bbolt.Open(path, dbFilePermission, nil)
|
||||
// Specify bbolt freelist options to reduce heap pressure in case the
|
||||
// freelist grows to be very large.
|
||||
options := &bbolt.Options{
|
||||
NoFreelistSync: true,
|
||||
FreelistType: bbolt.FreelistMapType,
|
||||
}
|
||||
|
||||
bdb, err := bbolt.Open(path, dbFilePermission, options)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user