Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public BlockInventoryMessage(byte[] raw_data)
     : base(raw_data)
 {
     this.type      = (byte)MessageTypes.MsgType.BLOCK_INVENTORY;
     this.inventory = Protocol.BlockInventory.Parser.ParseFrom(data);
 }