'Encode this block for transport
:param signature: False to pack EMPTY_SIG in the signature location, true to pack the signature field
:return: the buffer the data was packed into'

def pack(self, signature=True):

    encoded_tx = encode(self.transaction)
    buff = bytearray(block_pack_size)
    pack_into(block_pack_format, buff, 0, self.public_key, self.sequence_number, self.link_public_key, self.link_sequence_number, self.previous_hash, (self.signature if signature else EMPTY_SIG))
    return ((str(buff) + struct.pack('!I', len(encoded_tx))) + encoded_tx)
