Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling failed when Bitcoin core has an unencrypted wallet, but wallet password is passed #115

Closed
ripcurlx opened this issue Mar 15, 2022 · 4 comments
Assignees

Comments

@ripcurlx
Copy link
Contributor

When trying to connect to Bitcoin core passing a passphrase and the wallet is unencrypted it fails with

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Throwable.toString()" because the return value of "java.lang.Throwable.getCause()" is null
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Throwable.toString()" because the return value of "java.lang.Throwable.getCause()" is null

	at bisq.wallets.bitcoind.rpc.RpcClient.rpcAuthenticationFailed(RpcClient.java:77)
	at bisq.wallets.bitcoind.rpc.RpcClient.invoke(RpcClient.java:54)
	at bisq.wallets.bitcoind.BitcoindWalletBackend.walletPassphrase(BitcoindWalletBackend.java:141)
	at bisq.wallets.bitcoind.BitcoindWallet.initialize(BitcoindWallet.java:60)
	at bisq.wallets.WalletService.lambda$initialize$0(WalletService.java:47)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1800)

Because Error: running with an unencrypted wallet, but walletpassphrase was called. is returned and

private boolean rpcAuthenticationFailed(Throwable t) {
        return t.getCause().toString().contains("401");
    }

doesn't handle the case properly when no cause exists.

@ripcurlx
Copy link
Contributor Author

The weird thing is that I actually have protected my wallet in Bitcoin core with a passphrase.

@alvasw
Copy link
Contributor

alvasw commented Mar 15, 2022

Hey @ripcurlx!

Yeah, I know about the issue, and it's on my to-do list.

The weird thing is that I actually have protected my wallet in Bitcoin core with a passphrase.

Bitcoin Core supports multiple wallets (you can load and use many simultaneously). In Bisq 2, we create a new wallet. We don't touch any existing/loaded wallets.

@ripcurlx
Copy link
Contributor Author

Bitcoin Core supports multiple wallets (you can load and use many simultaneously). In Bisq 2, we create a new wallet. We don't touch any existing/loaded wallets.

Ah - just recognized the newly created wallet. 👍

alvasw added a commit to alvasw/bisq2 that referenced this issue Mar 18, 2022
At the moment, the wallet module raises a NullPointerException if the
wallet is not encrypted. This shouldn't happen.
chimp1984 added a commit that referenced this issue Mar 18, 2022
@alvasw
Copy link
Contributor

alvasw commented Mar 18, 2022

Fixed in #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants