code: def HandleGetDataMessageReceived(self, payload):
          
          inventory = IOHelper.AsSerializableWithType(payload, 'neo.Network.Payloads.InvPayload.InvPayload')
          if not inventory:
              return
  
          for hash in inventory.Hashes:
              hash = hash.encode('utf-8')
  
              item = None
              # try to get the inventory to send from relay cache
  
              if hash in self.leader.RelayCache.keys():
                  item = self.leader.RelayCache[hash]
  
              if inventory.Type == InventoryType.TXInt:
                  if not item:
                      item, index = BC.Default().GetTransaction(hash)
                  if not item:
                      item = self.leader.GetTransaction(hash)
                  if item:
                      message = Message(command='tx', payload=item, print_payload=False)
                      self.SendSerializedMessage(message)
  
              elif inventory.Type == InventoryType.BlockInt:
                  if not item:
                      item = BC.Default().GetBlock(hash)
                  if item:
                      message = Message(command='block', payload=item, print_payload=False)
                      self.SendSerializedMessage(message)
  
              elif inventory.Type == InventoryType.ConsensusInt:
                  if item:
                      self.SendSerializedMessage(Message(command='consensus', payload=item, print_payload=False))
docs: Process a InvPayload payload.
  
          Args:
              payload (neo.Network.Inventory):