我有以下代码:
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();
问题是txs list始终为null。我知道块头不包含事务,但我仍然不知道如何访问它们。
我相信我错过了很简单的事情。任何人都可以帮助我吗?