diff --git a/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java b/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java index 0b7e0587c..fa2a0eeb1 100644 --- a/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java +++ b/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java @@ -298,7 +298,7 @@ public class BitcoinSerializer extends MessageSerializer { */ @Override public Block makeBlock(ByteBuffer payload) throws ProtocolException { - return new Block(params, payload); + return new Block(payload); } /** @@ -316,7 +316,7 @@ public class BitcoinSerializer extends MessageSerializer { */ @Override public FilteredBlock makeFilteredBlock(ByteBuffer payload) throws ProtocolException { - return new FilteredBlock(params, payload); + return new FilteredBlock(payload); } /** diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java index 404b34d36..7d4c952c6 100644 --- a/core/src/main/java/org/bitcoinj/core/Block.java +++ b/core/src/main/java/org/bitcoinj/core/Block.java @@ -134,8 +134,8 @@ public class Block extends Message { private Sha256Hash hash; /** Special case constructor, used for the genesis node, cloneAsHeader and unit tests. */ - Block(NetworkParameters params, long setVersion) { - super(params); + Block(long setVersion) { + super(new DummySerializer(NetworkParameters.ProtocolVersion.CURRENT.getBitcoinProtocolVersion())); // Set up a few basic things. We are not complete after this though. version = setVersion; difficultyTarget = 0x1d07fff8L; @@ -145,18 +145,15 @@ public class Block extends Message { /** * Construct a block object from the Bitcoin wire format. - * @param params NetworkParameters object. * @param payload the payload to extract the block from. * @throws ProtocolException */ - public Block(NetworkParameters params, ByteBuffer payload) - throws ProtocolException { - super(params, payload); + public Block(ByteBuffer payload) throws ProtocolException { + super(payload, new DummySerializer(NetworkParameters.ProtocolVersion.CURRENT.getBitcoinProtocolVersion())); } /** * Construct a block initialized with all the given fields. - * @param params Which network the block is for. * @param version This should usually be set to 1 or 2, depending on if the height is in the coinbase input. * @param prevBlockHash Reference to previous block in the chain or {@link Sha256Hash#ZERO_HASH} if genesis. * @param merkleRoot The root of the merkle tree formed by the transactions. @@ -165,9 +162,9 @@ public class Block extends Message { * @param nonce Arbitrary number to make the block hash lower than the target. * @param transactions List of transactions including the coinbase. */ - public Block(NetworkParameters params, long version, Sha256Hash prevBlockHash, Sha256Hash merkleRoot, Instant time, + public Block(long version, Sha256Hash prevBlockHash, Sha256Hash merkleRoot, Instant time, long difficultyTarget, long nonce, List transactions) { - super(params); + super(); this.version = version; this.prevBlockHash = prevBlockHash; this.merkleRoot = merkleRoot; @@ -180,7 +177,6 @@ public class Block extends Message { /** * Construct a block initialized with all the given fields. - * @param params Which network the block is for. * @param version This should usually be set to 1 or 2, depending on if the height is in the coinbase input. * @param prevBlockHash Reference to previous block in the chain or {@link Sha256Hash#ZERO_HASH} if genesis. * @param merkleRoot The root of the merkle tree formed by the transactions. @@ -188,12 +184,12 @@ public class Block extends Message { * @param difficultyTarget Number which this block hashes lower than. * @param nonce Arbitrary number to make the block hash lower than the target. * @param transactions List of transactions including the coinbase. - * @deprecated use {@link #Block(NetworkParameters, long, Sha256Hash, Sha256Hash, Instant, long, long, List)} + * @deprecated use {@link #Block(long, Sha256Hash, Sha256Hash, Instant, long, long, List)} */ @Deprecated - public Block(NetworkParameters params, long version, Sha256Hash prevBlockHash, Sha256Hash merkleRoot, long time, + public Block(long version, Sha256Hash prevBlockHash, Sha256Hash merkleRoot, long time, long difficultyTarget, long nonce, List transactions) { - this(params, version, prevBlockHash, merkleRoot, Instant.ofEpochSecond(time), difficultyTarget, nonce, + this(version, prevBlockHash, merkleRoot, Instant.ofEpochSecond(time), difficultyTarget, nonce, transactions); } @@ -236,8 +232,8 @@ public class Block extends Message { parseTransactions(payload); } - public static Block createGenesis(NetworkParameters n) { - Block genesisBlock = new Block(n, BLOCK_VERSION_GENESIS); + public static Block createGenesis() { + Block genesisBlock = new Block(BLOCK_VERSION_GENESIS); Transaction tx = Transaction.coinbase(genesisTxInputScriptBytes); tx.addOutput(new TransactionOutput(tx, FIFTY_COINS, genesisTxScriptPubKeyBytes)); genesisBlock.addTransaction(tx); @@ -381,7 +377,7 @@ public class Block extends Message { * @return new, header-only {@code Block} */ public Block cloneAsHeader() { - Block block = new Block(params, version); + Block block = new Block(version); block.difficultyTarget = difficultyTarget; block.time = time; block.nonce = nonce; @@ -861,7 +857,7 @@ public class Block extends Message { @VisibleForTesting Block createNextBlock(@Nullable Address to, long version, @Nullable TransactionOutPoint prevOut, Instant time, byte[] pubKey, Coin coinbaseValue, int height) { - Block b = new Block(params, version); + Block b = new Block(version); b.setDifficultyTarget(difficultyTarget); b.addCoinbaseTransaction(pubKey, coinbaseValue, height); diff --git a/core/src/main/java/org/bitcoinj/core/BloomFilter.java b/core/src/main/java/org/bitcoinj/core/BloomFilter.java index 74beb4692..dcf4043b3 100644 --- a/core/src/main/java/org/bitcoinj/core/BloomFilter.java +++ b/core/src/main/java/org/bitcoinj/core/BloomFilter.java @@ -333,7 +333,7 @@ public class BloomFilter extends Message { } } PartialMerkleTree pmt = PartialMerkleTree.buildFromLeaves(bits, txHashes); - FilteredBlock filteredBlock = new FilteredBlock(block.getParams(), block.cloneAsHeader(), pmt); + FilteredBlock filteredBlock = new FilteredBlock(block.cloneAsHeader(), pmt); for (Transaction transaction : matched) filteredBlock.provideTransaction(transaction); return filteredBlock; diff --git a/core/src/main/java/org/bitcoinj/core/FilteredBlock.java b/core/src/main/java/org/bitcoinj/core/FilteredBlock.java index afbca293d..ec52a262e 100644 --- a/core/src/main/java/org/bitcoinj/core/FilteredBlock.java +++ b/core/src/main/java/org/bitcoinj/core/FilteredBlock.java @@ -47,12 +47,12 @@ public class FilteredBlock extends Message { // These were relayed as a part of the filteredblock getdata, ie likely weren't previously received as loose transactions private Map associatedTransactions = new HashMap<>(); - public FilteredBlock(NetworkParameters params, ByteBuffer payload) throws ProtocolException { - super(params, payload); + public FilteredBlock(ByteBuffer payload) throws ProtocolException { + super(payload); } - public FilteredBlock(NetworkParameters params, Block header, PartialMerkleTree pmt) { - super(params); + public FilteredBlock(Block header, PartialMerkleTree pmt) { + super(); this.header = header; this.merkleTree = pmt; } @@ -69,7 +69,7 @@ public class FilteredBlock extends Message { @Override protected void parse(ByteBuffer payload) throws BufferUnderflowException, ProtocolException { byte[] headerBytes = Buffers.readBytes(payload, Block.HEADER_SIZE); - header = new Block(params, ByteBuffer.wrap(headerBytes)); + header = new Block(ByteBuffer.wrap(headerBytes)); merkleTree = new PartialMerkleTree(payload); } diff --git a/core/src/main/java/org/bitcoinj/core/HeadersMessage.java b/core/src/main/java/org/bitcoinj/core/HeadersMessage.java index c574f4f6b..911a991cf 100644 --- a/core/src/main/java/org/bitcoinj/core/HeadersMessage.java +++ b/core/src/main/java/org/bitcoinj/core/HeadersMessage.java @@ -75,10 +75,8 @@ public class HeadersMessage extends Message { MAX_HEADERS); blockHeaders = new ArrayList<>(); - final BitcoinSerializer serializer = this.params.getSerializer(); - for (int i = 0; i < numHeaders; ++i) { - final Block newBlockHeader = new Block(params, payload); + final Block newBlockHeader = new Block(payload); if (newBlockHeader.hasTransactions()) { throw new ProtocolException("Block header does not end with a null byte"); } diff --git a/core/src/main/java/org/bitcoinj/params/MainNetParams.java b/core/src/main/java/org/bitcoinj/params/MainNetParams.java index 3362d5d11..d6c45e878 100644 --- a/core/src/main/java/org/bitcoinj/params/MainNetParams.java +++ b/core/src/main/java/org/bitcoinj/params/MainNetParams.java @@ -134,7 +134,7 @@ public class MainNetParams extends BitcoinNetworkParams { public Block getGenesisBlock() { synchronized (GENESIS_HASH) { if (genesisBlock == null) { - genesisBlock = Block.createGenesis(this); + genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(Block.STANDARD_MAX_DIFFICULTY_TARGET); genesisBlock.setTime(Instant.ofEpochSecond(GENESIS_TIME)); genesisBlock.setNonce(GENESIS_NONCE); diff --git a/core/src/main/java/org/bitcoinj/params/RegTestParams.java b/core/src/main/java/org/bitcoinj/params/RegTestParams.java index e56c968f4..b50441ed1 100644 --- a/core/src/main/java/org/bitcoinj/params/RegTestParams.java +++ b/core/src/main/java/org/bitcoinj/params/RegTestParams.java @@ -82,7 +82,7 @@ public class RegTestParams extends BitcoinNetworkParams { public Block getGenesisBlock() { synchronized (GENESIS_HASH) { if (genesisBlock == null) { - genesisBlock = Block.createGenesis(this); + genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(Block.EASIEST_DIFFICULTY_TARGET); genesisBlock.setTime(Instant.ofEpochSecond(GENESIS_TIME)); genesisBlock.setNonce(GENESIS_NONCE); diff --git a/core/src/main/java/org/bitcoinj/params/SigNetParams.java b/core/src/main/java/org/bitcoinj/params/SigNetParams.java index 533805714..82becc3f3 100644 --- a/core/src/main/java/org/bitcoinj/params/SigNetParams.java +++ b/core/src/main/java/org/bitcoinj/params/SigNetParams.java @@ -79,7 +79,7 @@ public class SigNetParams extends BitcoinNetworkParams { public Block getGenesisBlock() { synchronized (GENESIS_HASH) { if (genesisBlock == null) { - genesisBlock = Block.createGenesis(this); + genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(GENESIS_DIFFICULTY); genesisBlock.setTime(Instant.ofEpochSecond(GENESIS_TIME)); genesisBlock.setNonce(GENESIS_NONCE); diff --git a/core/src/main/java/org/bitcoinj/params/TestNet3Params.java b/core/src/main/java/org/bitcoinj/params/TestNet3Params.java index a51896310..41239d53f 100644 --- a/core/src/main/java/org/bitcoinj/params/TestNet3Params.java +++ b/core/src/main/java/org/bitcoinj/params/TestNet3Params.java @@ -88,7 +88,7 @@ public class TestNet3Params extends BitcoinNetworkParams { public Block getGenesisBlock() { synchronized (GENESIS_HASH) { if (genesisBlock == null) { - genesisBlock = Block.createGenesis(this); + genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(Block.STANDARD_MAX_DIFFICULTY_TARGET); genesisBlock.setTime(Instant.ofEpochSecond(GENESIS_TIME)); genesisBlock.setNonce(GENESIS_NONCE); diff --git a/core/src/main/java/org/bitcoinj/params/UnitTestParams.java b/core/src/main/java/org/bitcoinj/params/UnitTestParams.java index 7f198de48..1c4b1cbaa 100644 --- a/core/src/main/java/org/bitcoinj/params/UnitTestParams.java +++ b/core/src/main/java/org/bitcoinj/params/UnitTestParams.java @@ -73,7 +73,7 @@ public class UnitTestParams extends BitcoinNetworkParams { public Block getGenesisBlock() { synchronized (this) { if (genesisBlock == null) { - genesisBlock = Block.createGenesis(this); + genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(Block.EASIEST_DIFFICULTY_TARGET); genesisBlock.setTime(TimeUtils.currentTime()); genesisBlock.solve(); diff --git a/core/src/test/java/org/bitcoinj/core/BlockChainTest.java b/core/src/test/java/org/bitcoinj/core/BlockChainTest.java index e7f991093..3656cf1e3 100644 --- a/core/src/test/java/org/bitcoinj/core/BlockChainTest.java +++ b/core/src/test/java/org/bitcoinj/core/BlockChainTest.java @@ -217,7 +217,7 @@ public class BlockChainTest { assertTrue(testNetChain.add(getBlock1())); Block b2 = getBlock2(); assertTrue(testNetChain.add(b2)); - Block bad = new Block(TESTNET, Block.BLOCK_VERSION_GENESIS); + Block bad = new Block(Block.BLOCK_VERSION_GENESIS); // Merkle root can be anything here, doesn't matter. bad.setMerkleRoot(Sha256Hash.wrap("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); // Nonce was just some number that made the hash < difficulty limit set below, it can be anything. @@ -414,7 +414,7 @@ public class BlockChainTest { // Some blocks from the test net. private static Block getBlock2() throws Exception { - Block b2 = new Block(TESTNET, Block.BLOCK_VERSION_GENESIS); + Block b2 = new Block(Block.BLOCK_VERSION_GENESIS); b2.setMerkleRoot(Sha256Hash.wrap("20222eb90f5895556926c112bb5aa0df4ab5abc3107e21a6950aec3b2e3541e2")); b2.setNonce(875942400L); b2.setTime(Instant.ofEpochSecond(1296688946L)); @@ -426,7 +426,7 @@ public class BlockChainTest { } private static Block getBlock1() throws Exception { - Block b1 = new Block(TESTNET, Block.BLOCK_VERSION_GENESIS); + Block b1 = new Block(Block.BLOCK_VERSION_GENESIS); b1.setMerkleRoot(Sha256Hash.wrap("f0315ffc38709d70ad5647e22048358dd3745f3ce3874223c80a7c92fab0c8ba")); b1.setNonce(1924588547); b1.setTime(Instant.ofEpochSecond(1296688928)); diff --git a/core/src/test/java/org/bitcoinj/core/BlockTest.java b/core/src/test/java/org/bitcoinj/core/BlockTest.java index 4aec16169..e8e541e81 100644 --- a/core/src/test/java/org/bitcoinj/core/BlockTest.java +++ b/core/src/test/java/org/bitcoinj/core/BlockTest.java @@ -311,7 +311,7 @@ public class BlockTest { @Test public void parseBlockWithHugeDeclaredTransactionsSize() { Context.propagate(new Context(100, Transaction.DEFAULT_TX_FEE, false, true)); - Block block = new Block(TESTNET, 1, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, 1, 1, 1, new ArrayList()) { + Block block = new Block(1, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, 1, 1, 1, new ArrayList()) { @Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { ByteUtils.writeInt32LE(getVersion(), stream); @@ -335,7 +335,7 @@ public class BlockTest { @Test public void testGenesisBlock() { - Block genesisBlock = Block.createGenesis(MainNetParams.get()); + Block genesisBlock = Block.createGenesis(); genesisBlock.setDifficultyTarget(0x1d00ffffL); genesisBlock.setTime(Instant.ofEpochSecond(1231006505L)); genesisBlock.setNonce(2083236893); diff --git a/core/src/test/java/org/bitcoinj/core/FullBlockTestGenerator.java b/core/src/test/java/org/bitcoinj/core/FullBlockTestGenerator.java index d3ed4233e..cbb41be0f 100644 --- a/core/src/test/java/org/bitcoinj/core/FullBlockTestGenerator.java +++ b/core/src/test/java/org/bitcoinj/core/FullBlockTestGenerator.java @@ -898,7 +898,7 @@ public class FullBlockTestGenerator { TransactionOutPointWithValue out14 = spendableOutputs.poll(); // A valid block created exactly like b44 to make sure the creation itself works - Block b44 = new Block(params, Block.BLOCK_VERSION_GENESIS); + Block b44 = new Block(Block.BLOCK_VERSION_GENESIS); byte[] outScriptBytes = ScriptBuilder.createP2PKOutputScript(ECKey.fromPublicOnly(coinbaseOutKeyPubKey)).getProgram(); { b44.setDifficultyTarget(b43.block.getDifficultyTarget()); @@ -922,7 +922,7 @@ public class FullBlockTestGenerator { TransactionOutPointWithValue out15 = spendableOutputs.poll(); // A block with a non-coinbase as the first tx - Block b45 = new Block(params, Block.BLOCK_VERSION_GENESIS); + Block b45 = new Block(Block.BLOCK_VERSION_GENESIS); { b45.setDifficultyTarget(b44.getDifficultyTarget()); //b45.addCoinbaseTransaction(pubKey, coinbaseValue); @@ -948,7 +948,7 @@ public class FullBlockTestGenerator { blocks.add(new BlockAndValidity(b45, false, true, b44.getHash(), chainHeadHeight + 15, "b45")); // A block with no txn - Block b46 = new Block(params, Block.BLOCK_VERSION_GENESIS); + Block b46 = new Block(Block.BLOCK_VERSION_GENESIS); { b46.transactions = new ArrayList<>(); b46.setDifficultyTarget(b44.getDifficultyTarget()); diff --git a/core/src/test/java/org/bitcoinj/store/SPVBlockStoreTest.java b/core/src/test/java/org/bitcoinj/store/SPVBlockStoreTest.java index 1e65c386a..c134b66d4 100644 --- a/core/src/test/java/org/bitcoinj/store/SPVBlockStoreTest.java +++ b/core/src/test/java/org/bitcoinj/store/SPVBlockStoreTest.java @@ -150,7 +150,7 @@ public class SPVBlockStoreTest { Stopwatch watch = Stopwatch.start(); for (int i = 0; i < ITERATIONS; i++) { // Using i as the nonce so that the block hashes are different. - Block block = new Block(TESTNET, 0, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, 0, 0, i, + Block block = new Block(0, Sha256Hash.ZERO_HASH, Sha256Hash.ZERO_HASH, 0, 0, i, Collections.emptyList()); StoredBlock b = new StoredBlock(block, BigInteger.ZERO, i); store.put(b); diff --git a/integration-test/src/test/java/org/bitcoinj/core/FilteredBlockAndPartialMerkleTreeTest.java b/integration-test/src/test/java/org/bitcoinj/core/FilteredBlockAndPartialMerkleTreeTest.java index 1bd734a4d..884295e87 100644 --- a/integration-test/src/test/java/org/bitcoinj/core/FilteredBlockAndPartialMerkleTreeTest.java +++ b/integration-test/src/test/java/org/bitcoinj/core/FilteredBlockAndPartialMerkleTreeTest.java @@ -95,7 +95,7 @@ public class FilteredBlockAndPartialMerkleTreeTest extends TestWithPeerGroup { public void deserializeFilteredBlock() { // Random real block (000000000000dab0130bbcc991d3d7ae6b81aa6f50a798888dfe62337458dc45) // With one tx - FilteredBlock block = new FilteredBlock(TESTNET, ByteBuffer.wrap(ByteUtils.parseHex("0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b8fa45d630100000001b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f19630101"))); + FilteredBlock block = new FilteredBlock(ByteBuffer.wrap(ByteUtils.parseHex("0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b8fa45d630100000001b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f19630101"))); // Check that the header was properly deserialized assertEquals(Sha256Hash.wrap("000000000000dab0130bbcc991d3d7ae6b81aa6f50a798888dfe62337458dc45"), block.getBlockHeader().getHash()); @@ -106,7 +106,7 @@ public class FilteredBlockAndPartialMerkleTreeTest extends TestWithPeerGroup { assertTrue(txesMatched.contains(Sha256Hash.wrap("63194f18be0af63f2c6bc9dc0f777cbefed3d9415c4af83f3ee3a3d669c00cb5"))); // Check round tripping. - assertEquals(block, new FilteredBlock(TESTNET, ByteBuffer.wrap(block.bitcoinSerialize()))); + assertEquals(block, new FilteredBlock(ByteBuffer.wrap(block.bitcoinSerialize()))); } @Test @@ -154,7 +154,7 @@ public class FilteredBlockAndPartialMerkleTreeTest extends TestWithPeerGroup { // First we create all the necessary objects, including lots of serialization and double-checks // Note that all serialized forms here are generated by Bitcoin Core/pulled from block explorer Block block = SERIALIZER.makeBlock(ByteBuffer.wrap(ByteUtils.parseHex("0100000006e533fd1ada86391f3f6c343204b0d278d4aaec1c0b20aa27ba0300000000006abbb3eb3d733a9fe18967fd7d4c117e4ccbbac5bec4d910d900b3ae0793e77f54241b4d4c86041b4089cc9b0c01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b010dffffffff0100f2052a01000000434104b27f7e9475ccf5d9a431cb86d665b8302c140144ec2397fce792f4a4e7765fecf8128534eaa71df04f93c74676ae8279195128a1506ebf7379d23dab8fca0f63ac000000000100000001d992e5a888a86d4c7a6a69167a4728ee69497509740fc5f456a24528c340219a000000008b483045022100f0519bdc9282ff476da1323b8ef7ffe33f495c1a8d52cc522b437022d83f6a230220159b61d197fbae01b4a66622a23bc3f1def65d5fa24efd5c26fa872f3a246b8e014104839f9023296a1fabb133140128ca2709f6818c7d099491690bd8ac0fd55279def6a2ceb6ab7b5e4a71889b6e739f09509565eec789e86886f6f936fa42097adeffffffff02000fe208010000001976a914948c765a6914d43f2a7ac177da2c2f6b52de3d7c88ac00e32321000000001976a9140c34f4e29ab5a615d5ea28d4817f12b137d62ed588ac0000000001000000059daf0abe7a92618546a9dbcfd65869b6178c66ec21ccfda878c1175979cfd9ef000000004a493046022100c2f7f25be5de6ce88ac3c1a519514379e91f39b31ddff279a3db0b1a229b708b022100b29efbdbd9837cc6a6c7318aa4900ed7e4d65662c34d1622a2035a3a5534a99a01ffffffffd516330ebdf075948da56db13d22632a4fb941122df2884397dda45d451acefb0000000048473044022051243debe6d4f2b433bee0cee78c5c4073ead0e3bde54296dbed6176e128659c022044417bfe16f44eb7b6eb0cdf077b9ce972a332e15395c09ca5e4f602958d266101ffffffffe1f5aa33961227b3c344e57179417ce01b7ccd421117fe2336289b70489883f900000000484730440220593252bb992ce3c85baf28d6e3aa32065816271d2c822398fe7ee28a856bc943022066d429dd5025d3c86fd8fd8a58e183a844bd94aa312cefe00388f57c85b0ca3201ffffffffe207e83718129505e6a7484831442f668164ae659fddb82e9e5421a081fb90d50000000049483045022067cf27eb733e5bcae412a586b25a74417c237161a084167c2a0b439abfebdcb2022100efcc6baa6824b4c5205aa967e0b76d31abf89e738d4b6b014e788c9a8cccaf0c01ffffffffe23b8d9d80a9e9d977fab3c94dbe37befee63822443c3ec5ae5a713ede66c3940000000049483045022020f2eb35036666b1debe0d1d2e77a36d5d9c4e96c1dba23f5100f193dbf524790221008ce79bc1321fb4357c6daee818038d41544749127751726e46b2b320c8b565a201ffffffff0200ba1dd2050000001976a914366a27645806e817a6cd40bc869bdad92fe5509188ac40420f00000000001976a914ee8bd501094a7d5ca318da2506de35e1cb025ddc88ac0000000001000000010abad2dc0c9b4b1dbb023077da513f81e5a71788d8680fca98ef1c37356c459c000000004a493046022100a894e521c87b3dbe23007079db4ac2896e9e791f8b57317ba6c0d99a7becd27a022100bc40981393eafeb33e89079f857c728701a9af4523c3f857cd96a500f240780901ffffffff024026ee22010000001976a914d28f9cefb58c1f7a5f97aa6b79047585f58fbd4388acc0cb1707000000001976a9142229481696e417aa5f51ad751d8cd4c6a669e4fe88ac000000000100000001f66d89b3649e0b18d84db056930676cb81c0168042fc4324c3682e252ea9410d0000000048473044022038e0b55b37c9253bfeda59c76c0134530f91fb586d6eb21738a77a984f370a44022048d4d477aaf97ef9c8275bbc5cb19b9c8a0e9b1f9fdafdd39bc85bf6c2f04a4d01ffffffff024041a523010000001976a914955f70ac8792b48b7bd52b15413bd8500ecf32c888ac00f36f06000000001976a91486116d15f3dbb23a2b58346f36e6ec2d867eba2b88ac00000000010000000126c384984f63446a4f2be8dd6531ba9837bd5f2c3d37403c5f51fb9192ee754e010000008b48304502210083af8324456f052ff1b2597ff0e6a8cce8b006e379a410cf781be7874a2691c2022072259e2f7292960dea0ffc361bbad0b861f719beb8550476f22ce0f82c023449014104f3ed46a81cba02af0593e8572a9130adb0d348b538c829ccaaf8e6075b78439b2746a76891ce7ba71abbcbb7ca76e8a220782738a6789562827c1065b0ce911dffffffff02c0dd9107000000001976a91463d4dd1b29d95ed601512b487bfc1c49d84d057988ac00a0491a010000001976a91465746bef92511df7b34abf71c162efb7ae353de388ac0000000001000000011b56cf3aab3286d582c055a42af3a911ee08423f276da702bb67f1222ac1a5b6000000008c4930460221009e9fba682e162c9627b96b7df272006a727988680b956c61baff869f0907b8fb022100a9c19adc7c36144bafe526630783845e5cb9554d30d3edfb56f0740274d507f30141046e0efbfac7b1615ad553a6f097615bc63b7cdb3b8e1cb3263b619ba63740012f51c7c5b09390e3577e377b7537e61226e315f95f926444fc5e5f2978c112e448ffffffff02c0072b11010000001976a914b73e9e01933351ca076faf8e0d94dd58079d0b1f88ac80b63908000000001976a9141aca0bdf0d2cee63db19aa4a484f45a4e26a880c88ac000000000100000001251b187504ea873b2c3915fad401f7a7734cc13567e0417708e86294a29f4f68010000008b4830450221009bef423141ed1ae60d0a5bcaa57b1673fc96001f0d4e105535cca817ba5a7724022037c399bd30374f22481ffc81327cfca4951c7264b227f765fcd6a429f3d9d2080141044d0d1b4f194c31a73dbce41c42b4b3946849117c5bb320467e014bad3b1532f28a9a1568ba7108f188e7823b6e618e91d974306701379a27b9339e646e156e7bffffffff02c00fd103010000001976a914ef7f5d9e1bc6ed68cfe0b1db9d8f09cef0f3ba4a88ac004dd208000000001976a914c22420641cea028c9e06c4d9104c1646f8b1769088ac0000000001000000013486dd5f0a2f3efcc04f64cb03872c021f98ee39f514747ce5336b874bbe47a7010000008b48304502201cadddc2838598fee7dc35a12b340c6bde8b389f7bfd19a1252a17c4b5ed2d71022100c1a251bbecb14b058a8bd77f65de87e51c47e95904f4c0e9d52eddc21c1415ac014104fe7df86d58aafa9246ca6fd30c905714533c25f700e2329b8ecec8aa52083b844baa3a8acd5d6b9732dcb39079bb56ba2711a3580dec824955fce0596a460c11ffffffff02c011f6e1000000001976a91490fac83c9adde91d670dde8755f8b475ab9e427d88acc0f9df15000000001976a91437f691b3e8ee5dcb56c2e31af4c80caa2df3b09b88ac00000000010000000170016bd1274b795b262f32a53003a4714b22b62f9057adf5fbe6ed939003b5190100000089463043022061456499582170a94d6b54308f792e37dad28bf0ed7aa61021f0301d2774d378021f4224b33f707efd810a01dd34ea86d6069cd599cc435513a0eef8c83c137bf7014104a2c95d6b98e745448eb45ed0ba95cf24dd7c3b16386e1028e24a0358ee4afc33e2f0199139853edaf32845d8a42254c75f7dc8add3286c682c650fbd93f0a4a1ffffffff02001bd2b7000000001976a9141b11c6acaa5223013f3a3240fdb024ecd9f8135488ac8023ad18000000001976a914ada27ca87bbaa1ee6fb1cb61bb0a29baaf6da2c988ac000000000100000001c8ff91f031ec6a5aba4baee6549e61dd01f26f61b70e2f1574f24cd680f464ad000000008b48304502210082235e21a2300022738dabb8e1bbd9d19cfb1e7ab8c30a23b0afbb8d178abcf3022024bf68e256c534ddfaf966bf908deb944305596f7bdcc38d69acad7f9c868724014104174f9eef1157dc1ad5eac198250b70d1c3b04b2fca12ad1483f07358486f02909b088bbc83f4de55f767f6cdf9d424aa02b5eeaffa08394d39b717895fc08d0affffffff0200ea3b43000000001976a914fb32df708f0610901f6d1b6df8c9c368fe0d981c88ac800f1777000000001976a914462c501c70fb996d15ac0771e7fc8d3ca3f7201888ac000000000100000001c67323867de802402e780a70e0deba3c708c4d87497e17590afee9c321f1c680010000008a473044022042734b25f54845d662e6499b75ff8529ff47f42fd224498a9f752d212326dbfa0220523e4b7b570bbb1f3af02baa2c04ea8eb7b0fccb1522cced130b666ae9a9d014014104b5a23b922949877e9eaf7512897ed091958e2e8cf05b0d0eb9064e7976043fde6023b4e2c188b7e38ef94eec6845dc4933f5e8635f1f6a3702290956aa9e284bffffffff0280041838030000001976a91436e5884215f7d3044be5d37bdd8c987d9d942c8488ac404b4c00000000001976a91460085d6838f8a44a21a0de56ff963cfa6242a96188ac00000000"))); - FilteredBlock filteredBlock = new FilteredBlock(TESTNET, ByteBuffer.wrap(ByteUtils.parseHex("0100000006e533fd1ada86391f3f6c343204b0d278d4aaec1c0b20aa27ba0300000000006abbb3eb3d733a9fe18967fd7d4c117e4ccbbac5bec4d910d900b3ae0793e77f54241b4d4c86041b4089cc9b0c000000084c30b63cfcdc2d35e3329421b9805ef0c6565d35381ca857762ea0b3a5a128bbca5065ff9617cbcba45eb23726df6498a9b9cafed4f54cbab9d227b0035ddefbbb15ac1d57d0182aaee61c74743a9c4f785895e563909bafec45c9a2b0ff3181d77706be8b1dcc91112eada86d424e2d0a8907c3488b6e44fda5a74a25cbc7d6bb4fa04245f4ac8a1a571d5537eac24adca1454d65eda446055479af6c6d4dd3c9ab658448c10b6921b7a4ce3021eb22ed6bb6a7fde1e5bcc4b1db6615c6abc5ca042127bfaf9f44ebce29cb29c6df9d05b47f35b2edff4f0064b578ab741fa78276222651209fe1a2c4c0fa1c58510aec8b090dd1eb1f82f9d261b8273b525b02ff1a"))); + FilteredBlock filteredBlock = new FilteredBlock(ByteBuffer.wrap(ByteUtils.parseHex("0100000006e533fd1ada86391f3f6c343204b0d278d4aaec1c0b20aa27ba0300000000006abbb3eb3d733a9fe18967fd7d4c117e4ccbbac5bec4d910d900b3ae0793e77f54241b4d4c86041b4089cc9b0c000000084c30b63cfcdc2d35e3329421b9805ef0c6565d35381ca857762ea0b3a5a128bbca5065ff9617cbcba45eb23726df6498a9b9cafed4f54cbab9d227b0035ddefbbb15ac1d57d0182aaee61c74743a9c4f785895e563909bafec45c9a2b0ff3181d77706be8b1dcc91112eada86d424e2d0a8907c3488b6e44fda5a74a25cbc7d6bb4fa04245f4ac8a1a571d5537eac24adca1454d65eda446055479af6c6d4dd3c9ab658448c10b6921b7a4ce3021eb22ed6bb6a7fde1e5bcc4b1db6615c6abc5ca042127bfaf9f44ebce29cb29c6df9d05b47f35b2edff4f0064b578ab741fa78276222651209fe1a2c4c0fa1c58510aec8b090dd1eb1f82f9d261b8273b525b02ff1a"))); // Block 100001 assertEquals(Sha256Hash.wrap("00000000000080b66c911bd5ba14a74260057311eaeb1982802f7010f1a9f090"), block.getHash());