'Create an empty next block.
:param database: the database to use as information source
:param transaction: the transaction to use in this block
:param public_key: the public key to use for this block
:param link: optionally create the block as a linked block to this block
:param link_pk: the public key of the counterparty in this transaction
:return: A newly created block'

@classmethod
def create(cls, transaction, database, public_key, link=None, link_pk=None):

    blk = database.get_latest(public_key)
    ret = cls()
    if link:
        ret.transaction['up'] = link.transaction['down']
        ret.transaction['down'] = link.transaction['up']
        ret.link_public_key = link.public_key
        ret.link_sequence_number = link.sequence_number
    else:
        ret.transaction['up'] = transaction['up']
        ret.transaction['down'] = transaction['down']
        ret.link_public_key = link_pk
    if blk:
        ret.transaction['total_up'] = (blk.transaction['total_up'] + ret.transaction['up'])
        ret.transaction['total_down'] = (blk.transaction['total_down'] + ret.transaction['down'])
        ret.sequence_number = (blk.sequence_number + 1)
        ret.previous_hash = blk.hash
    else:
        ret.transaction['total_up'] = ret.transaction['up']
        ret.transaction['total_down'] = ret.transaction['down']
    ret.public_key = public_key
    ret.signature = EMPTY_SIG
    return ret
