public class FilteredBlock extends Message
A FilteredBlock is used to relay a block with its transactions filtered using a BloomFilter. It consists
of the block header and a PartialMerkleTree which contains the transactions which matched the filter.
Message.LazyParseException| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_PROTOCOL_VERSION
The protocol version at which Bloom filtering started to be supported.
|
checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, payload, protocolVersion, recached, UNKNOWN_LENGTH| Constructor and Description |
|---|
FilteredBlock(NetworkParameters params,
Block header,
PartialMerkleTree pmt) |
FilteredBlock(NetworkParameters params,
byte[] payloadBytes) |
| Modifier and Type | Method and Description |
|---|---|
void |
bitcoinSerializeToStream(OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(Object o) |
Map<Sha256Hash,Transaction> |
getAssociatedTransactions()
Gets the set of transactions which were provided using provideTransaction() which match in getTransactionHashes()
|
Block |
getBlockHeader()
Gets a copy of the block header
|
Sha256Hash |
getHash()
Gets the hash of the block represented in this Filtered Block
|
int |
getTransactionCount()
Number of transactions in this block, before it was filtered
|
List<Sha256Hash> |
getTransactionHashes()
Gets a list of leaf hashes which are contained in the partial merkle tree in this filtered block
|
int |
hashCode() |
protected void |
parseLite()
Perform the most minimal parse possible to calculate the length of the message payload.
|
boolean |
provideTransaction(Transaction tx)
Provide this FilteredBlock with a transaction which is in its merkle tree
|
String |
toString() |
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerializepublic static final int MIN_PROTOCOL_VERSION
public FilteredBlock(NetworkParameters params, byte[] payloadBytes) throws ProtocolException
ProtocolExceptionpublic FilteredBlock(NetworkParameters params, Block header, PartialMerkleTree pmt)
public void bitcoinSerializeToStream(OutputStream stream) throws IOException
MessageIOExceptionprotected void parseLite()
throws ProtocolException
MessageparseLite in class MessageProtocolExceptionpublic List<Sha256Hash> getTransactionHashes() throws VerificationException
ProtocolException - If the partial merkle block is invalid or the merkle root of the partial merkle block doesnt match the block headerVerificationExceptionpublic Block getBlockHeader()
public Sha256Hash getHash()
public boolean provideTransaction(Transaction tx) throws VerificationException
VerificationExceptionpublic Map<Sha256Hash,Transaction> getAssociatedTransactions()
public int getTransactionCount()
Copyright © 2014. All rights reserved.