Wallet problems

98 views
Skip to first unread message

Maksimilano

unread,
Mar 24, 2022, 3:38:54 PM3/24/22
to bitcoinj
Good afternoon! I ran into a few problems while using the library. I am using this sample from github https://github.com/bitcoinj/bitcoinj/blob/master/examples/src/main/java/org/bitcoinj/examples/SendRequest.java, but added WalletFabric for creating wallet with existed key
Library has created a file with blockchain .spvchain and .wallet on first run

1.  The balance in it is correct. But if I delete the .wallet file and run the code again, the Wallet#getBalance() method shows 0 and no transactions. Do I need to delete .spvchain when deleting .wallet or can I somehow update the wallet?

2. By running the code from the example on the github, I sent some test coins, but the transaction is not confirmed and is constantly in the pending state in the wallet. Why this can be and how to fix it (I can provide transaction logs)?

3. Sometimes synchronization is very long and can take 30-50 minutes. The following logs are in the console: Peer does not support bloom filtering. ConnectionHandler.handleKey: Error handling SelectionKey: java.nio.channels.CancelledKeyException
java.nio.channels.CancelledKeyException
        at java.base/sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:74)
        at java.base/sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:133)
        at java.base/java.nio.channels.SelectionKey.isWritable(SelectionKey.java:378)
        at org.bitcoinj.net.ConnectionHandler.handleKey(ConnectionHandler.java:244)
        at org.bitcoinj.net.NioClientManager.handleKey(NioClientManager.java:86)
        at org.bitcoinj.net.NioClientManager.run(NioClientManager.java:122)
        at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:66)
        at com.google.common.util.concurrent.Callables$4.run(Callables.java:121)
        at org.bitcoinj.utils.ContextPropagatingThreadFactory.lambda$newThread$0(ContextPropagatingThreadFactory.java:48)
        at java.base/java.lang.Thread.run(Thread.java:832)
Reply all
Reply to author
Forward
0 new messages