File file = new File("195da336-a311-4f69-8707-fcfb5f61dd5a.dat");
Wallet wallet = Wallet.loadFromFile(file);
System.out.println(wallet.getBalance().toFriendlyString());
// Set up the components and link them together.
final NetworkParameters params = TestNet3Params.get();
BlockStore blockStore = new MemoryBlockStore(params);
BlockChain chain = new BlockChain(params, wallet, blockStore);
final PeerGroup peerGroup = new PeerGroup(params, chain);
peerGroup.setFastCatchupTimeSecs(wallet.getEarliestKeyCreationTime());
peerGroup.startAsync();
// Now download and process the block chain.
peerGroup.downloadBlockChain();
peerGroup.stopAsync();
wallet.saveToFile(file);
System.out.println("Synchronization completed");
System.out.println(wallet.getBalance().toFriendlyString());
wallet.autosaveToFile(new File("app.wallet"), 1000, TimeUnit.MILLISECONDS,null);
peerGrp.addWallet(wallet);
If i create a new wallet how do i initialize the balance instead of using the existing ones?
--
You received this message because you are subscribed to a topic in the Google Groups "bitcoinj" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bitcoinj/tujoTbBy4j4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bitcoinj+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to bitcoinj+u...@googlegroups.com.