btcwallet
btcwallet copied to clipboard
Error opening wallet: unknown database type
Hi,
I created a new wallet using btcwallet --create
command. After that I started the wallet service along with RPC node. Everything got synced. However, when I try to open that wallet.db
, I'm getting an unknown database type
error. Here's the code:
Assuming walletDbPath
points to the actual ./btcwallet/testnet/
and there's a wallet.db
file:
loader := wallet.NewLoader(&chaincfg.TestNet3Params, "walletDbPath", 0)
wallet, err := loader.OpenExistingWallet([]byte("password"), false)
if err != nil {
log.Fatalf("error opening wallet: %v", err)
}
Am I opening wrong file or is there something else I need to consider?
The Loader uses "bdb" db driver, so you'll need to import it using the Blank Identifier ( _
)
import(
_ "github.com/btcsuite/btcwallet/walletdb/bdb"
)