Skip to content

Commit aaf5a16

Browse files
committed
walletinfo: add missing timeout arg to walletdb open
1 parent ffa1c22 commit aaf5a16

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cmd/chantools/walletinfo.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/btcsuite/btcwallet/waddrmgr"
1414
"github.com/btcsuite/btcwallet/wallet"
1515
"github.com/btcsuite/btcwallet/walletdb"
16+
"github.com/guggero/chantools/lnd"
1617
"github.com/lightningnetwork/lnd/keychain"
1718
"github.com/lightningnetwork/lnd/lnwallet"
1819

@@ -94,7 +95,10 @@ func (c *walletInfoCommand) Execute(_ []string) error {
9495
}
9596

9697
// Try to load and open the wallet.
97-
db, err := walletdb.Open("bdb", cleanAndExpandPath(c.WalletDB), false)
98+
db, err := walletdb.Open(
99+
"bdb", cleanAndExpandPath(c.WalletDB), false,
100+
lnd.DefaultOpenTimeout,
101+
)
98102
if err != nil {
99103
return fmt.Errorf("error opening wallet database: %v", err)
100104
}

lnd/channeldb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
)
1212

1313
const (
14-
defaultOpenTimeout = time.Second * 10
14+
DefaultOpenTimeout = time.Second * 10
1515
)
1616

1717
func OpenDB(dbPath string, readonly bool) (*channeldb.DB, error) {
18-
backend, err := openDB(dbPath, false, readonly, defaultOpenTimeout)
18+
backend, err := openDB(dbPath, false, readonly, DefaultOpenTimeout)
1919
if err != nil {
2020
return nil, err
2121
}

0 commit comments

Comments
 (0)