'We received a payment message originating from the market community. We set pending bytes so the validator
passes when we receive the half block from the counterparty.
Note that it might also be possible that the half block has been received already. That\'s why we revalidate
the invalid messages again.'

def received_payment_message(self, payment_id):

    (pub_key, seq_num, bytes_up, bytes_down) = payment_id.split('.')
    pub_key = pub_key.decode('hex')
    pend = self.pending_bytes.get(pub_key)
    if (not pend):
        self.pending_bytes[pub_key] = PendingBytes(int(bytes_up), int(bytes_down), None)
    else:
        pend.add(int(bytes_up), int(bytes_down))
    block_id = ('%s.%s' % (pub_key.encode('hex'), seq_num))
    if (block_id in self.pending_sign_messages):
        self._logger.debug('Signing    pending    half    block')
        message = self.pending_sign_messages[block_id]
        self.sign_block(message.candidate, linked=message.payload.block)
        del self.pending_sign_messages[block_id]
