Guys, I need help, first of all I'm sorry if the question was very beginning.
I downloaded bitcointCore, installed it on my machine and did all the testing. 
Everything working, I used bitcoinj to create a wallet and it was also perfect, 
however, when I asked the bitncoinj to connect to my bitcoincore and creating 
the wallet gives the following error.



java.nio.channels.NotYetConnectedException
        at 
org.bitcoinj.core.PeerSocketHandler.sendMessage(PeerSocketHandler.java:82)
        at org.bitcoinj.core.Peer.connectionOpened(Peer.java:435)
        at cadu.cadu.BitCoingTeste.CreateWallet(BitCoingTeste.java:86)
        at cadu.cadu.BitCoingTeste.main(BitCoingTeste.java:30)




Follow my source, I know I'm doing something erraod can anyone help me?
                ECKey ecKey = new ECKey();
                NetworkParameters netParams = NetworkParameters.testNet3();
                BlockStore blockStore = new MemoryBlockStore(netParams);

                File walletFile = new File("user.wallet");
                
                
                        Wallet wallet = new Wallet(netParams);
                        BlockChain chain = new BlockChain(netParams, wallet, 
blockStore);
                        
                        VersionMessage v = new VersionMessage(netParams, 
VersionMessage.NODE_NETWORK);
                        Peer peer = new Peer(netParams, v, chain,  new 
PeerAddress(InetAddress.getLocalHost()));
                        peer.connectionOpened();
                        wallet.addKey(ecKey);
                        wallet.saveToFile(walletFile);
                        
                        wallet = Wallet.loadFromFile(walletFile);
                        Address a = wallet.currentReceiveAddress();
                        
                        System.out.println(a.toString());
                        System.out.println(a.toBase58());
                

tks
Cadu

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to