sparrow: Sparrow will no longer connect to bitcoin core

Sparrow suddenly won’t connect to the bitcoin core even though it was previously working. I have not changed any of the configuration. Note that it won’t connect locally on the bitcoin core machine either (again, used to work). Here is the error that appears on the test connection screen:

Could not connect: Check if Bitcoin Core is running, and the authentication details are correct. _See https://sparrowwallet.com/docs/connect-node.html_

Here is the error log: 2022-10-28 10:55:28,139 ERROR [JavaFX Application Thread] c.s.s.n.ElectrumServer [null:-1] Failed to start BWT dev.bwt.libbwt.BwtException: JSON-RPC error: JSON decode error: missing field keypoololdest at line 1 column 334 at com.sparrowwallet.merged.module@1.7.0/dev.bwt.libbwt.daemon.NativeBwtDaemon.start(Native Method) at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.Bwt.start(Unknown Source) at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.Bwt.start(Unknown Source) at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.Bwt$ConnectionService$1.call(Unknown Source) at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.Bwt$ConnectionService$1.call(Unknown Source) at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) 2022-10-28 10:55:28,140 ERROR [JavaFX Application Thread] c.s.s.p.ServerPreferencesController [null:-1] Connection error com.sparrowwallet.sparrow.net.ServerException: Check if Bitcoin Core is running, and the authentication details are correct. at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.ElectrumServer$ConnectionService$1.call(Unknown Source) at com.sparrowwallet.sparrow@1.7.0/com.sparrowwallet.sparrow.net.ElectrumServer$ConnectionService$1.call(Unknown Source) at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

The authentication information is correct in the bitcoin core configuration file (like I said, used to work).

It seems to halfway work as the following screen appears on the bitcoin core: BitcoinCore

I have Windows 10 on both machines, Sparrow v1.7.0 and bitcoin core v23.0.

java version “1.8.0_351” Java™ SE Runtime Environment (build 1.8.0_351-b10) Java HotSpot™ 64-Bit Server VM (build 25.351-b10, mixed mode)

Any suggestions appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Most upvoted comments

This is due to Bitcoin Core changing the default wallet type to descriptor wallets. See #488.

To solve this, start by upgrading Sparrow to the latest release. Shut down both Bitcoin Core and Sparrow, delete the sparrow folder in the Bitcoin Core wallets folder, restart Bitcoin Core and then Sparrow. This will recreate the sparrow wallet in Bitcoin Core using the correct type.

So in case of setting up a hardware wallet: Should I create a hot software wallet as described by you before importing or setting up a hardware wallet?

No, you can create any wallet. The important part is that the wallet is saved, and Sparrow adds the public keys it references to the Bitcoin Core wallet it creates.

Ok, I’ve managed to recreate it - the field keypoololdest is not returned when reloading an existing legacy Bitcoin Core wallet that has had no keys added to it. I’ve created an issue for BWT: https://github.com/bwt-dev/bwt/issues/108.

The current solution is to stop both Bitcoin Core and Sparrow, delete the Bitcoin Core wallet, restart both and then make sure to create a wallet in Sparrow before restarting either application (to ensure some keys are added to the Bitcoin Core wallet).

@ExchangeREC I think this is the “problem”:

I have not connected/created/imported any wallet on Sparrow yet

Once you have Sparrow connected to Bitcoin Core, create a wallet (a hot wallet is file) and the problem should go away. It appears that the keypoololdest field is not returned if no keys have been imported into the wallet. Ref https://github.com/bitcoin/bitcoin/blob/e334f7a54592ba9f05e4a5578dd933a7a31c3444/src/wallet/rpc/wallet.cpp#L91

Oddly enough I can’t reproduce this myself, even with a freshly created Bitcoin Core wallet without any keys imported - keypoololdest is always returned:

{
  "walletname": "sparrow",
  "walletversion": 169900,
  "format": "bdb",
  "balance": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 0,
  "keypoololdest": 1670826633,
  "keypoolsize": 0,
  "keypoolsize_hd_internal": 0,
  "paytxfee": 0.00000000,
  "private_keys_enabled": false,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false,
  "external_signer": false
}

It appears so, here is the output:

Chain: main
Blocks: 760699
Headers: 760699
Verification progress: 99.9999%
Difficulty: 36835682546787.98

Network: in 0, out 10, total 10
Version: 230000
Time offset (s): 0
Proxies: n/a
Min tx relay fee rate (BTC/kvB): 0.00001000

Wallet: sparrow
Keypool size: 0
Transaction fee rate (-paytxfee) (BTC/kvB): 0.00000000

Balance: 0.00000000

Warnings: