public static PartialMerkleTree buildFromLeaves(NetworkParameters params,byte[] includeBits,List<Sha256Hash> allLeafHashes){
  int height=0;
  while (getTreeWidth(allLeafHashes.size(),height) > 1)   height++;
  List<Boolean> bitList=new ArrayList<Boolean>();
  List<Sha256Hash> hashes=new ArrayList<Sha256Hash>();
  traverseAndBuild(height,0,allLeafHashes,includeBits,bitList,hashes);
  byte[] bits=new byte[(int)Math.ceil(bitList.size() / 8.0)];
  for (int i=0; i < bitList.size(); i++)   if (bitList.get(i))   Utils.setBitLE(bits,i);
  return new PartialMerkleTree(params,bits,hashes,allLeafHashes.size());
}

public static PartialMerkleTree buildFromLeaves ( NetworkParameters params , byte [ ] includeBits , List < Sha256Hash > allLeafHashes ) { int height = 0 ; while ( getTreeWidth ( allLeafHashes . size ( ) , height ) > 1 ) height ++ ; List < Boolean > bitList = new ArrayList < Boolean > ( ) ; List < Sha256Hash > hashes = new ArrayList < Sha256Hash > ( ) ; traverseAndBuild ( height , 0 , allLeafHashes , includeBits , bitList , hashes ) ; byte [ ] bits = new byte [ ( int ) Math . ceil ( bitList . size ( ) / 8.0 ) ] ; for ( int i = 0 ; i < bitList . size ( ) ; i ++ ) if ( bitList . get ( i ) ) Utils . setBitLE ( bits , i ) ; return new PartialMerkleTree ( params , bits , hashes , allLeafHashes . size ( ) ) ; }
calculates a pmt given the list of leaf hashes and which leaves need to be included . the relevant interior hashes are calculated and a new pmt returned .
