Just wanted to ask a question about "importwallet" bitcoin-cli command.
After starting my bitcoind daemon, created a wallet, protected with a passphrase and made a backup to a file:
bitcoin-cli createwallet wallet1
bitcoin-cli encryptwallet mypassword
bitcoin-cli backupwallet ~/wallet1.backup
I want to test if I am able to recover my backuped wallet. This is what I am testing:
bitcoin-cli stop
rm -Rf ~./bitcoin/wallets/wallet1
And then start again my bitcoind server. At this point I want to import my wallet. I try this:
$ bitcoin-cli importwallet ~/wallet1.backup
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)
But as you can see, the bitcoin-cli is requesting to create a new wallet. Just to import an existing one? I don't understand that point.
For this particular example, what should be the proper way to import the wallet? Tnks!