Block block = new Block ();
block.setVersion (pb.getVersion ());
block.setDifficultyTarget (pb.getDifficulty ());
block.setNonce (pb.getNonce ());
block.setCreateTime (pb.getTimestamp ());
block.setPreviousHash (new Hash (pb.getPreviousBlock ().toByteArray ()).toString ());
block.setMerkleRoot (new Hash (pb.getMerkleRoot ().toByteArray ()).toString ());
if ( pb.getTransactionsCount () > 0 )
{
block.setTransactions (new ArrayList<Transaction> ());
for ( BCSAPIMessage.Transaction t : pb.getTransactionsList () )
{