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

When I use MainNetParams, I always start with the following exception. What does this mean? #38

Open
fastener opened this issue Apr 30, 2018 · 5 comments

Comments

@fastener
Copy link

Error handling SelectionKey: java.nio.channels.CancelledKeyException
java.nio.channels.CancelledKeyException
at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:73)
at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:87)
at java.nio.channels.SelectionKey.isWritable(SelectionKey.java:312)
at org.bitcoinj.net.ConnectionHandler.handleKey(ConnectionHandler.java:229)
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:60)
at com.google.common.util.concurrent.Callables$3.run(Callables.java:95)
at org.bitcoinj.utils.ContextPropagatingThreadFactory$1.run(ContextPropagatingThreadFactory.java:49)
at java.lang.Thread.run(Thread.java:745)

@fastener
Copy link
Author

When I receive the transaction, I will have the following error message later. What does this mean?

Apr 30, 2018 3:03:29 PM org.bitcoinj.wallet.WalletFiles saveNow
信息: Saving wallet; last seen block is height 528127, date 2018-04-30T07:03:02Z, hash 000000000000000000d41b5ccccadcafdcb6a45e95212a51c6c42bc92cd9ce50

Apr 30, 2018 3:03:29 PM org.bitcoinj.wallet.WalletFiles saveNowInternal
信息: Save completed in 11.46 ms
Apr 30, 2018 3:03:34 PM org.bitcoinj.wallet.WalletFiles$1 call
信息: Background saving wallet; last seen block is height 528127, date 2018-04-30T07:03:02Z, hash 000000000000000000d41b5ccccadcafdcb6a45e95212a51c6c42bc92cd9ce50
Apr 30, 2018 3:03:34 PM org.bitcoinj.wallet.WalletFiles saveNowInternal
信息: Save completed in 16.10 ms
Apr 30, 2018 3:04:00 PM org.bitcoinj.core.Context get
严重: Performing thread fixup: you are accessing bitcoinj via a thread that has not had any context set on it.
Apr 30, 2018 3:04:00 PM org.bitcoinj.core.Context get
严重: This error has been corrected for, but doing this makes your app less robust.
Apr 30, 2018 3:04:00 PM org.bitcoinj.core.Context get
严重: You should use Context.propagate() or a ContextPropagatingThreadFactory.
Apr 30, 2018 3:04:00 PM org.bitcoinj.core.Context get
严重: Please refer to the user guide for more information about this.
Apr 30, 2018 3:04:00 PM org.bitcoinj.core.Context get
严重: Thread name is http-bio-8081-exec-7.
Apr 30, 2018 3:05:39 PM org.bitcoinj.core.Context get
严重: Performing thread fixup: you are accessing bitcoinj via a thread that has not had any context set on it.
Apr 30, 2018 3:05:39 PM org.bitcoinj.core.Context get
严重: This error has been corrected for, but doing this makes your app less robust.
Apr 30, 2018 3:05:39 PM org.bitcoinj.core.Context get
严重: You should use Context.propagate() or a ContextPropagatingThreadFactory.
Apr 30, 2018 3:05:39 PM org.bitcoinj.core.Context get
严重: Please refer to the user guide for more information about this.
Apr 30, 2018 3:05:39 PM org.bitcoinj.core.Context get
严重: Thread name is http-bio-8081-exec-5.

@HashEngineering
Copy link
Collaborator

The first may be a peer or dnsseed that gets disconnected.

The second tells you about the warning. A thread is started without using Context.propagate.

@fastener
Copy link
Author

fastener commented May 7, 2018

How to solve this problem? When I use MainNetParams, the transaction status I receive is always unspent.

@HashEngineering
Copy link
Collaborator

If you are talking about the first exception, those happen from time to time, the key is to have more peers to connect to. How many peers is your software connecting to?

@fastener
Copy link
Author

fastener commented May 8, 2018

When I use MainNetParams, the transaction status I receive is always unspent.
This is a new problem
dnsSeeds = new String[] {
"seed.bitcoinabc.org",
"seed-abc.bitcoinforks.org",
"btccash-seeder.bitcoinunlimited.info",
"seed.bitprim.org",
"seed.deadalnix.me",
"seeder.criptolayer.net"
};
I use the default dnsSeeds and do not set the number of peer connections.

The following is the log:
May 08, 2018 3:58:30 PM org.bitcoinj.core.PeerSocketHandler timeoutOccurred
信息: [198.245.51.212]:8333: Timed out
May 08, 2018 3:58:30 PM org.bitcoinj.core.PeerGroup handlePeerDeath
信息: [198.245.51.212]:8333: Peer died (14 connected, 0 pending, 12 max)

wallet address:1295TuNjuJs4apzAXdEy5cK5Hwcp8D5pu9 wallet Wallet containing 0.004 BCH (spendable: 0.004 BCH) in:
0 pending transactions
2 unspent transactions
0 spent transactions
0 dead transactions

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

2 participants