@Test public void intraBlockDependencies() throws Exception { Address somebodyElse = new ECKey().toAddress(unitTestParams); Block b1 = unitTestParams.getGenesisBlock().createNextBlock(somebodyElse); ECKey key = new ECKey(); wallet.addKey(key); Address addr = key.toAddress(unitTestParams); Transaction t1 = TestUtils.createFakeTx(unitTestParams, Utils.toNanoCoins(1, 0), addr); Transaction t2 = new Transaction(unitTestParams); t2.addInput(t1.getOutputs().get(0)); t2.addOutput(Utils.toNanoCoins(2, 0), somebodyElse); b1.addTransaction(t1); b1.addTransaction(t2); b1.solve(); chain.add(b1); assertEquals(BigInteger.ZERO, wallet.getBalance()); }
@Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success; }
BlockChain extends AbstractBlockChain { @Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success; } }
BlockChain extends AbstractBlockChain { @Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success; } BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore);  BlockChain(NetworkParameters params, BlockStore blockStore);  BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                      BlockStore blockStore); }
BlockChain extends AbstractBlockChain { @Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success; } BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore);  BlockChain(NetworkParameters params, BlockStore blockStore);  BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                      BlockStore blockStore); @Override boolean add(FilteredBlock block); }
BlockChain extends AbstractBlockChain { @Override public boolean add(FilteredBlock block) throws VerificationException, PrunedException { boolean success = super.add(block); if (success) { trackFilteredTransactions(block.getTransactionCount()); } return success; } BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore);  BlockChain(NetworkParameters params, BlockStore blockStore);  BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                      BlockStore blockStore); @Override boolean add(FilteredBlock block);  }