'Create, sign, persist and send a block signed message
:param candidate: The peer with whom you have interacted, as a dispersy candidate
:param transaction: A string describing the interaction in this block
:param linked: The block that the requester is asking us to sign'

def sign_block(self, candidate, public_key=None, transaction=None, linked=None):

    assert (((transaction is None) and (linked is not None)) or ((transaction is not None) and (linked is None))), 'Either    provide    a    linked    block    or    a    transaction,    not    both'
    assert ((linked is None) or (linked.link_public_key == self.my_member.public_key)), 'Cannot    counter    sign    block    not    addressed    to    self'
    assert ((linked is None) or (linked.link_sequence_number == UNKNOWN_SEQ)), 'Cannot    counter    sign    block    that    is    not    a    request'
    assert ((transaction is None) or isinstance(transaction, dict)), 'Transaction    should    be    a    dictionary'
    block = self.BLOCK_CLASS.create(transaction, self.persistence, self.my_member.public_key, link=linked, link_pk=public_key)
    block.sign(self.my_member.private_key)
    validation = block.validate(self.persistence)
    self.logger.info('Signed    block    to    %s    (%s)    validation    result    %s', block.link_public_key.encode('hex')[(-8):], block, validation)
    if ((validation[0] != ValidationResult.partial_next) and (validation[0] != ValidationResult.valid)):
        self.logger.error('Signed    block    did    not    validate?!    Result    %s', repr(validation))
    else:
        self.persistence.add_block(block)
        self.send_block(candidate, block)
