Merge pull request #3578 from wpaulino/no-freelist-sync-option

config: add sync freelist cli flag
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-10-04 15:16:30 -07:00
commit 5ef1f85998
15 files changed
+66 -33

No files matched your search

+4 -2
View File
@@ -89,8 +89,10 @@ func New(cfg Config) (*BtcWallet, error) {
} else {
pubPass = cfg.PublicPass
}
loader := base.NewLoader(cfg.NetParams, netDir,
cfg.RecoveryWindow)
loader := base.NewLoader(
cfg.NetParams, netDir, cfg.NoFreelistSync,
cfg.RecoveryWindow,
)
walletExists, err := loader.WalletExists()
if err != nil {
return nil, err
+5
View File
@@ -75,6 +75,11 @@ type Config struct {
// encrypted at all, in which case it should be attempted to be loaded
// normally when creating the BtcWallet.
Wallet *wallet.Wallet
// NoFreelistSync, if true, prevents the database from syncing its
// freelist to disk, resulting in improved performance at the expense of
// increased startup time.
NoFreelistSync bool
}
// NetworkDir returns the directory name of a network directory to hold wallet
+6 -4
View File
@@ -2804,8 +2804,9 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver,
// Start Alice - open a database, start a neutrino
// instance, and initialize a btcwallet driver for it.
aliceDB, err := walletdb.Create("bdb",
tempTestDirAlice+"/neutrino.db")
aliceDB, err := walletdb.Create(
"bdb", tempTestDirAlice+"/neutrino.db", true,
)
if err != nil {
t.Fatalf("unable to create DB: %v", err)
}
@@ -2831,8 +2832,9 @@ func runTests(t *testing.T, walletDriver *lnwallet.WalletDriver,
// Start Bob - open a database, start a neutrino
// instance, and initialize a btcwallet driver for it.
bobDB, err := walletdb.Create("bdb",
tempTestDirBob+"/neutrino.db")
bobDB, err := walletdb.Create(
"bdb", tempTestDirBob+"/neutrino.db", true,
)
if err != nil {
t.Fatalf("unable to create DB: %v", err)
}