public BlockInventoryMessage(List <BlockId> ids, BlockInventory.Types.Type type)
        {
            this.inventory = new BlockInventory();
            ids.ForEach(id =>
            {
                BlockInventory.Types.BlockId block_id = new BlockInventory.Types.BlockId();
                block_id.Hash   = id.Hash.ToByteString();
                block_id.Number = id.Num;
                this.inventory.Ids.Add(block_id);
            });

            this.inventory.Type = type;
            this.type           = (byte)MessageTypes.MsgType.BLOCK_INVENTORY;
            this.data           = inventory.ToByteArray();
        }
 public BlockInventoryMessage(byte[] raw_data)
     : base(raw_data)
 {
     this.type      = (byte)MessageTypes.MsgType.BLOCK_INVENTORY;
     this.inventory = Protocol.BlockInventory.Parser.ParseFrom(data);
 }