mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 18:00:39 +01:00
FilteredBlock: simplify parse()
a bit by using readBytes()
This commit is contained in:
parent
52b2f63d70
commit
01bf08159d
@ -66,10 +66,8 @@ public class FilteredBlock extends Message {
|
||||
|
||||
@Override
|
||||
protected void parse() throws ProtocolException {
|
||||
byte[] headerBytes = new byte[Block.HEADER_SIZE];
|
||||
System.arraycopy(payload, 0, headerBytes, 0, Block.HEADER_SIZE);
|
||||
byte[] headerBytes = readBytes(Block.HEADER_SIZE);
|
||||
header = params.getDefaultSerializer().makeBlock(ByteBuffer.wrap(headerBytes));
|
||||
|
||||
merkleTree = new PartialMerkleTree(params, ByteBuffer.wrap(payload, Block.HEADER_SIZE, length - Block.HEADER_SIZE));
|
||||
|
||||
length = Block.HEADER_SIZE + merkleTree.getMessageSize();
|
||||
|
Loading…
Reference in New Issue
Block a user