test_class.declarator: testNetChain
test_class.modifier: private
test_class.original_string: private BlockChain testNetChain;
test_class.type: BlockChain
test_class.var_name: testNetChain
test_class.declarator: wallet
test_class.modifier: private
test_class.original_string: private Wallet wallet;
test_class.type: Wallet
test_class.var_name: wallet
test_class.declarator: chain
test_class.modifier: private
test_class.original_string: private BlockChain chain;
test_class.type: BlockChain
test_class.var_name: chain
test_class.declarator: blockStore
test_class.modifier: private
test_class.original_string: private BlockStore blockStore;
test_class.type: BlockStore
test_class.var_name: blockStore
test_class.declarator: coinbaseTo
test_class.modifier: private
test_class.original_string: private Address coinbaseTo;
test_class.type: Address
test_class.var_name: coinbaseTo
test_class.declarator: unitTestParams
test_class.modifier: private
test_class.original_string: private NetworkParameters unitTestParams;
test_class.type: NetworkParameters
test_class.var_name: unitTestParams
test_class.declarator: block = new StoredBlock[1]
test_class.modifier: private final
test_class.original_string: private final StoredBlock[] block = new StoredBlock[1];
test_class.type: StoredBlock[]
test_class.var_name: block
test_class.declarator: coinbaseTransaction
test_class.modifier: private
test_class.original_string: private Transaction coinbaseTransaction;
test_class.type: Transaction
test_class.var_name: coinbaseTransaction
test_class.declarator: testNet = new TweakableTestNet2Params()
test_class.modifier: private static final
test_class.original_string: private static final TweakableTestNet2Params testNet = new TweakableTestNet2Params();
test_class.type: TweakableTestNet2Params
test_class.var_name: testNet
test_class.file: core/src/test/java/com/google/bitcoin/core/BlockChainTest.java
test_class.identifier: BlockChainTest
test_case.body: @Test
      public void merkleRoots() throws Exception {
          // Test that merkle root verification takes place when a relevant transaction is present and doesn't when
          // there isn't any such tx present (as an optimization).
          Transaction tx1 = createFakeTx(unitTestParams,
                                         Utils.toNanoCoins(1, 0),
                                         wallet.getKeys().get(0).toAddress(unitTestParams));
          Block b1 = createFakeBlock(blockStore, tx1).block;
          chain.add(b1);
          resetBlockStore();
          Sha256Hash hash = b1.getMerkleRoot();
          b1.setMerkleRoot(Sha256Hash.ZERO_HASH);
          try {
              chain.add(b1);
              fail();
          } catch (VerificationException e) {
              // Expected.
              b1.setMerkleRoot(hash);
          }
          // Now add a second block with no relevant transactions and then break it.
          Transaction tx2 = createFakeTx(unitTestParams, Utils.toNanoCoins(1, 0),
                                         new ECKey().toAddress(unitTestParams));
          Block b2 = createFakeBlock(blockStore, tx2).block;
          b2.getMerkleRoot();
          b2.setMerkleRoot(Sha256Hash.ZERO_HASH);
          b2.solve();
          chain.add(b2);  // Broken block is accepted because its contents don't matter to us.
      }
test_case.class_method_signature: BlockChainTest.merkleRoots()
test_case.full_signature: @Test public void merkleRoots()
test_case.identifier: merkleRoots
test_case.invocations: createFakeTx toNanoCoins toAddress get getKeys createFakeBlock add resetBlockStore getMerkleRoot setMerkleRoot add fail setMerkleRoot createFakeTx toNanoCoins toAddress createFakeBlock getMerkleRoot setMerkleRoot solve add
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void merkleRoots()
focal_class.declarator: blockStore
focal_class.modifier: protected final
focal_class.original_string: protected final BlockStore blockStore;
focal_class.type: BlockStore
focal_class.var_name: blockStore
focal_class.file: core/src/main/java/com/google/bitcoin/core/BlockChain.java
focal_class.identifier: BlockChain
focal_class.class_method_signature: BlockChain.BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore)
focal_class.full_signature: public  BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore)
focal_class.identifier: BlockChain
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, Wallet wallet, BlockStore blockStore)
focal_class.signature:  BlockChain(NetworkParameters params, Wallet wallet, BlockStore blockStore)
focal_class.class_method_signature: BlockChain.BlockChain(NetworkParameters params, BlockStore blockStore)
focal_class.full_signature: public  BlockChain(NetworkParameters params, BlockStore blockStore)
focal_class.identifier: BlockChain
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, BlockStore blockStore)
focal_class.signature:  BlockChain(NetworkParameters params, BlockStore blockStore)
focal_class.class_method_signature: BlockChain.BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                        BlockStore blockStore)
focal_class.full_signature: public  BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                        BlockStore blockStore)
focal_class.identifier: BlockChain
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, List<BlockChainListener> wallets,
                        BlockStore blockStore)
focal_class.signature:  BlockChain(NetworkParameters params, List<BlockChainListener> wallets,
                        BlockStore blockStore)
focal_class.class_method_signature: BlockChain.addToBlockStore(StoredBlock storedPrev, Block blockHeader, TransactionOutputChanges txOutChanges)
focal_class.full_signature: @Override protected StoredBlock addToBlockStore(StoredBlock storedPrev, Block blockHeader, TransactionOutputChanges txOutChanges)
focal_class.identifier: addToBlockStore
focal_class.modifiers: @Override protected
focal_class.parameters: (StoredBlock storedPrev, Block blockHeader, TransactionOutputChanges txOutChanges)
focal_class.return: StoredBlock
focal_class.signature: StoredBlock addToBlockStore(StoredBlock storedPrev, Block blockHeader, TransactionOutputChanges txOutChanges)
focal_class.class_method_signature: BlockChain.addToBlockStore(StoredBlock storedPrev, Block blockHeader)
focal_class.full_signature: @Override protected StoredBlock addToBlockStore(StoredBlock storedPrev, Block blockHeader)
focal_class.identifier: addToBlockStore
focal_class.modifiers: @Override protected
focal_class.parameters: (StoredBlock storedPrev, Block blockHeader)
focal_class.return: StoredBlock
focal_class.signature: StoredBlock addToBlockStore(StoredBlock storedPrev, Block blockHeader)
focal_class.class_method_signature: BlockChain.shouldVerifyTransactions()
focal_class.full_signature: @Override protected boolean shouldVerifyTransactions()
focal_class.identifier: shouldVerifyTransactions
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean shouldVerifyTransactions()
focal_class.class_method_signature: BlockChain.connectTransactions(int height, Block block)
focal_class.full_signature: @Override protected TransactionOutputChanges connectTransactions(int height, Block block)
focal_class.identifier: connectTransactions
focal_class.modifiers: @Override protected
focal_class.parameters: (int height, Block block)
focal_class.return: TransactionOutputChanges
focal_class.signature: TransactionOutputChanges connectTransactions(int height, Block block)
focal_class.class_method_signature: BlockChain.connectTransactions(StoredBlock newBlock)
focal_class.full_signature: @Override protected TransactionOutputChanges connectTransactions(StoredBlock newBlock)
focal_class.identifier: connectTransactions
focal_class.modifiers: @Override protected
focal_class.parameters: (StoredBlock newBlock)
focal_class.return: TransactionOutputChanges
focal_class.signature: TransactionOutputChanges connectTransactions(StoredBlock newBlock)
focal_class.class_method_signature: BlockChain.disconnectTransactions(StoredBlock block)
focal_class.full_signature: @Override protected void disconnectTransactions(StoredBlock block)
focal_class.identifier: disconnectTransactions
focal_class.modifiers: @Override protected
focal_class.parameters: (StoredBlock block)
focal_class.return: void
focal_class.signature: void disconnectTransactions(StoredBlock block)
focal_class.class_method_signature: BlockChain.doSetChainHead(StoredBlock chainHead)
focal_class.full_signature: @Override protected void doSetChainHead(StoredBlock chainHead)
focal_class.identifier: doSetChainHead
focal_class.modifiers: @Override protected
focal_class.parameters: (StoredBlock chainHead)
focal_class.return: void
focal_class.signature: void doSetChainHead(StoredBlock chainHead)
focal_class.class_method_signature: BlockChain.notSettingChainHead()
focal_class.full_signature: @Override protected void notSettingChainHead()
focal_class.identifier: notSettingChainHead
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void notSettingChainHead()
focal_class.class_method_signature: BlockChain.getStoredBlockInCurrentScope(Sha256Hash hash)
focal_class.full_signature: @Override protected StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash)
focal_class.identifier: getStoredBlockInCurrentScope
focal_class.modifiers: @Override protected
focal_class.parameters: (Sha256Hash hash)
focal_class.return: StoredBlock
focal_class.signature: StoredBlock getStoredBlockInCurrentScope(Sha256Hash hash)
focal_class.class_method_signature: BlockChain.add(FilteredBlock block)
focal_class.full_signature: @Override public boolean add(FilteredBlock block)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (FilteredBlock block)
focal_class.return: boolean
focal_class.signature: boolean add(FilteredBlock block)
focal_class.superclass: extends AbstractBlockChain
focal_method.body: @Override
      public boolean add(FilteredBlock block) throws VerificationException, PrunedException {
          boolean success = super.add(block);
          if (success) {
              trackFilteredTransactions(block.getTransactionCount());
          }
          return success;
      }
focal_method.class_method_signature: BlockChain.add(FilteredBlock block)
focal_method.full_signature: @Override public boolean add(FilteredBlock block)
focal_method.identifier: add
focal_method.invocations: add trackFilteredTransactions getTransactionCount
focal_method.modifiers: @Override public
focal_method.parameters: (FilteredBlock block)
focal_method.return: boolean
focal_method.signature: boolean add(FilteredBlock block)