def on_traversal_request(self, messages):
        for message in messages:
            msg_dict = {'identifier': message.payload.dictionary['identifier']}

            try:
                contract_type = ObjectType(message.payload.dictionary['contract_type'])
            except (ValueError, KeyError):
                contract_type = None

            contract = self.traverse_contracts(message.payload.dictionary['contract_id'],
                                               contract_type)
            if contract is not None:
                msg_dict['contract'] = contract.to_dict()

                # Add the number of confirmations this contract has
                confirmations = self.find_confirmation_count(message.payload.dictionary['contract_id'])
                if confirmations is not None:
                    msg_dict['confirmations'] = confirmations

            self.send_message(u'traversal-response', (message.candidate,), msg_dict)