@Override
    public boolean add(FilteredBlock block) throws VerificationException, PrunedException {
        boolean success = super.add(block);
        if (success) {
            trackFilteredTransactions(block.getTransactionCount());
        }
        return success;
    }
@Test
    public void duplicates() throws Exception {
        Context.propagate(new Context(100, Coin.ZERO, false, true));
        // Adding a block twice should not have any effect, in particular it should not send the block to the wallet.
        Block b1 = TESTNET.getGenesisBlock().createNextBlock(coinbaseTo);
        Block b2 = b1.createNextBlock(coinbaseTo);
        Block b3 = b2.createNextBlock(coinbaseTo);
        assertTrue(testNetChain.add(b1));
        assertEquals(b1, testNetChain.getChainHead().getHeader());
        assertTrue(testNetChain.add(b2));
        assertEquals(b2, testNetChain.getChainHead().getHeader());
        assertTrue(testNetChain.add(b3));
        assertEquals(b3, testNetChain.getChainHead().getHeader());
        assertTrue(testNetChain.add(b2)); // add old block
        assertEquals(b3, testNetChain.getChainHead().getHeader()); // block didn't change, duplicate was spotted
    }