3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 18:55:52 +00:00

Add FilteredBlock.getPartialMerkleTree()

This commit is contained in:
Mike Hearn 2015-04-07 19:23:06 +02:00
parent c426e34646
commit 527274a40f

View File

@ -101,8 +101,8 @@ public class FilteredBlock extends Message {
} }
/** /**
* Provide this FilteredBlock with a transaction which is in its merkle tree * Provide this FilteredBlock with a transaction which is in its Merkle tree.
* @returns false if the tx is not relevant to this FilteredBlock * @return false if the tx is not relevant to this FilteredBlock
*/ */
public boolean provideTransaction(Transaction tx) throws VerificationException { public boolean provideTransaction(Transaction tx) throws VerificationException {
Sha256Hash hash = tx.getHash(); Sha256Hash hash = tx.getHash();
@ -113,6 +113,11 @@ public class FilteredBlock extends Message {
return false; return false;
} }
/** Returns the {@link PartialMerkleTree} object that provides the mathematical proof of transaction inclusion in the block. */
public PartialMerkleTree getPartialMerkleTree() {
return merkleTree;
}
/** Gets the set of transactions which were provided using provideTransaction() which match in getTransactionHashes() */ /** Gets the set of transactions which were provided using provideTransaction() which match in getTransactionHashes() */
public Map<Sha256Hash, Transaction> getAssociatedTransactions() { public Map<Sha256Hash, Transaction> getAssociatedTransactions() {
return Collections.unmodifiableMap(associatedTransactions); return Collections.unmodifiableMap(associatedTransactions);