1

I have the following code:

H2FullPrunedBlockStore h2BlockStore = new H2FullPrunedBlockStore(params, "path", 1000);
BlockChain chain = new BlockChain(params, h2BlockStore);
PeerGroup peerGroup = new PeerGroup(params, chain);
DnsDiscovery dnsDiscovery = new DnsDiscovery(params);
peerGroup.addPeerDiscovery(dnsDiscovery);
peerGroup.start();
peerGroup.waitForPeers(1).get();
peerGroup.downloadBlockChain();
List<Transaction> txs = h2BlockStore.getChainHead().getHeader().getTransactions();

The problem is that txs list is always null. I understand that block header does not contains transactions, but I still don't know how to access them.

I believe that I've missed something very simple. Can anyone help me?

4

0 回答 0