bwt-dev / bwt

A lightweight wallet indexer for Bitcoin, available as an Electrum RPC server and a modern HTTP REST API.

Home Page:https://bwt.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code: -18, message: "No wallet is loaded"

maxidev opened this issue · comments

commented

Hi there, I have Bitcoin core v.0.21 already synced and tried to watch some address with --address or xpub with --xpub but in any case I got:
Error: JSON-RPC error: RPC error response: RpcError { code: -18, 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)", data: None }
Every configuration is default, am I doing something wrong?

commented

Update: had to run bitcoin-cli createwallet to first create a wallet into bitcoin core and then I was able to watch an address, but is this the right flow? regards.
Also, doing this (even with unused address) I always get:

failed: ImportMultiResult { success: false, warnings: [], error: Some(ImportMultiResultError { code: -1, message: "Rescan failed for key with creation timestamp 0. There was an error reading a block from time 1614942461, which is after or within 7200 seconds of key creation, and could contain transactions pertaining to the key. As a result, transactions and coins using this key may not appear in the wallet. This error could be caused by pruning or data corruption (see bitcoind log for details) and could be dealt with by downloading and rescanning the relevant blocks (see -reindex and -rescan options)." }) }

I'm running a prunned node.

run bitcoin-cli createwallet to first create a wallet into bitcoin core and then I was able to watch an address, but is this the right flow?

Yes, Bitcoin Core v0.21 no longer comes with a default wallet, so one has to be created. If you have multiple wallets you can use --bitcoind-wallet <name> (or -w <name>) to specify which one to use. You can also use --create-wallet-if-missing to have bwt create one of your automatically.

Together, you can use -w bwt --create-wallet-if-missing to create a 'bwt' wallet for use with bwt.

See https://github.com/bwt-dev/bwt#bitcoin-core-multi-wallet.

Rescan failed for key with creation timestamp 0.

If you have pruning enabled, you need to set --rescan-since <date> with a YYYY-MM-DD formatted date that is within the range of non-pruned blocks. This should be set to the approximate time where the wallet was created (err on the too early side).

See https://github.com/bwt-dev/bwt#pruning

Closing for now, please report back if you're still having issues.

error code: -4
error message:
Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core?

I tried to loadwallet, but it reports the above issue. | I use pruned node.