code: def HandleGetBlocksMessageReceived(self, payload):
          
          if not self.leader.ServiceEnabled:
              return
  
          inventory = IOHelper.AsSerializableWithType(payload, 'neo.Network.Payloads.GetBlocksPayload.GetBlocksPayload')
          if not inventory:
              return
  
          blockchain = BC.Default()
          hash = inventory.HashStart[0]
          if not blockchain.GetHeader(hash):
              return
  
          hashes = []
          hcount = 0
          while hash != inventory.HashStop and hcount < 500:
              hash = blockchain.GetNextBlockHash(hash)
              if hash is None:
                  break
              hashes.append(hash)
              hcount += 1
          if hcount > 0:
              self.SendSerializedMessage(Message('inv', InvPayload(type=InventoryType.Block, hashes=hashes)))
docs: Process a GetBlocksPayload payload.
  
          Args:
              payload (neo.Network.Payloads.GetBlocksPayload):