async def _calc_routing_hints_for_invoice(self, amount_msat: Optional[int]):
    "calculate routing hints (BOLT-11 'r' field)"
    routing_hints = []
    channels = list(self.channels.values())
    channels = [chan for chan in channels if (chan.is_open() and (not chan.is_frozen_for_receiving()))]
    channels = sorted(channels, key=(lambda chan: ((not chan.is_active()), (- chan.available_to_spend(REMOTE)))))
    channels = channels[:15]
    random.shuffle(channels)
    scid_to_my_channels = {chan.short_channel_id: chan for chan in channels if (chan.short_channel_id is not None)}
    for chan in channels:
        chan_id = chan.short_channel_id
        assert isinstance(chan_id, bytes), chan_id
        channel_info = get_mychannel_info(chan_id, scid_to_my_channels)
        fee_base_msat = fee_proportional_millionths = 0
        cltv_expiry_delta = 1
        missing_info = True
        if channel_info:
            policy = get_mychannel_policy(channel_info.short_channel_id, chan.node_id, scid_to_my_channels)
            if policy:
                fee_base_msat = policy.fee_base_msat
                fee_proportional_millionths = policy.fee_proportional_millionths
                cltv_expiry_delta = policy.cltv_expiry_delta
                missing_info = False
        if missing_info:
            self.logger.info(f'Warning. Missing channel update for our channel {chan_id}; filling invoice with incorrect data.')
        routing_hints.append(('r', [(chan.node_id, chan_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta)]))
    return routing_hints
calculate routing hints (BOLT-11 'r' field)
async def _calc_routing_hints_for_invoice(self, amount_msat: Optional[int]):
    
    routing_hints = []
    channels = list(self.channels.values())
    channels = [chan for chan in channels if (chan.is_open() and (not chan.is_frozen_for_receiving()))]
    channels = sorted(channels, key=(lambda chan: ((not chan.is_active()), (- chan.available_to_spend(REMOTE)))))
    channels = channels[:15]
    random.shuffle(channels)
    scid_to_my_channels = {chan.short_channel_id: chan for chan in channels if (chan.short_channel_id is not None)}
    for chan in channels:
        chan_id = chan.short_channel_id
        assert isinstance(chan_id, bytes), chan_id
        channel_info = get_mychannel_info(chan_id, scid_to_my_channels)
        fee_base_msat = fee_proportional_millionths = 0
        cltv_expiry_delta = 1
        missing_info = True
        if channel_info:
            policy = get_mychannel_policy(channel_info.short_channel_id, chan.node_id, scid_to_my_channels)
            if policy:
                fee_base_msat = policy.fee_base_msat
                fee_proportional_millionths = policy.fee_proportional_millionths
                cltv_expiry_delta = policy.cltv_expiry_delta
                missing_info = False
        if missing_info:
            self.logger.info(f'Warning. Missing channel update for our channel {chan_id}; filling invoice with incorrect data.')
        routing_hints.append(('r', [(chan.node_id, chan_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta)]))
    return routing_hints