Open rajarshimaitra opened 2 years ago
It seems I ran into something very much like this while testing BDK 0.23 against bitcoind 0.23.0, when trying to create a wallet and get addresses:
let core_config = RpcConfig {
url: "127.0.0.1:18443".to_string(),
auth: rpc_auth,
network: bdk::bitcoin::Network::Regtest,
wallet_name: "test".to_string(),
sync_params: None,
};
let core_rpc = RpcBlockchain::from_config(&core_config).unwrap();
println!("{:#?}", core_rpc.get_blockchain_info().unwrap());
let core_address = core_rpc.get_new_address(None, None).unwrap();
Which appears to create the wallet, but then returns this error on get_new_address
:
"Error: This wallet has no available keys"
We found in the BDK test module that
RpcApi::create_wallet()
isn't working as expected with core v0.23.0.. https://github.com/bitcoindevkit/bdk/issues/598The same call that was creating a legacy wallet for core v0.22.0 and before, is now creating a descriptor wallet in v0.23.0.
The workaround fix for now is to make the manual
call()
with "createwallet" command as done in this PR https://github.com/bitcoindevkit/bdk/pull/613.I also noticed that the
create_wallet()
arg list here (including defaults) are not consistent withbitcoin-cli creatwallet
args as per v0.23.0.It takes 8 args, but the function is passing in 9 args..
So most probably something is going wrong in parsing the args, and createwallet is not reading the descriptor flag. And as per v0.23.0 descriptors are default wallets in core.