async def pay_to_route(self, *, route: LNPaymentRoute, amount_msat: int, total_msat: int, amount_receiver_msat: int, payment_hash: bytes, payment_secret: Optional[bytes], min_cltv_expiry: int, trampoline_onion: bytes=None) -> None:
    short_channel_id = route[0].short_channel_id
    chan = self.get_channel_by_short_id(short_channel_id)
    peer = self._peers.get(route[0].node_id)
    if (not peer):
        raise PaymentFailure('Dropped peer')
    (await peer.initialized)
    htlc = peer.pay(route=route, chan=chan, amount_msat=amount_msat, total_msat=total_msat, payment_hash=payment_hash, min_final_cltv_expiry=min_cltv_expiry, payment_secret=payment_secret, trampoline_onion=trampoline_onion)
    key = (payment_hash, short_channel_id, htlc.htlc_id)
    self.sent_htlcs_routes[key] = (route, payment_secret, amount_msat, total_msat, amount_receiver_msat)
    if ((not self.channel_db) and (amount_msat != total_msat)):
        if (payment_secret not in self.sent_buckets):
            self.sent_buckets[payment_secret] = (0, 0)
        (amount_sent, amount_failed) = self.sent_buckets[payment_secret]
        amount_sent += amount_receiver_msat
        self.sent_buckets[payment_secret] = (amount_sent, amount_failed)
    util.trigger_callback('htlc_added', chan, htlc, SENT)
async def pay_to_route(self, *, route: LNPaymentRoute, amount_msat: int, total_msat: int, amount_receiver_msat: int, payment_hash: bytes, payment_secret: Optional[bytes], min_cltv_expiry: int, trampoline_onion: bytes=None) -> None:
    short_channel_id = route[0].short_channel_id
    chan = self.get_channel_by_short_id(short_channel_id)
    peer = self._peers.get(route[0].node_id)
    if (not peer):
        raise PaymentFailure('Dropped peer')
    (await peer.initialized)
    htlc = peer.pay(route=route, chan=chan, amount_msat=amount_msat, total_msat=total_msat, payment_hash=payment_hash, min_final_cltv_expiry=min_cltv_expiry, payment_secret=payment_secret, trampoline_onion=trampoline_onion)
    key = (payment_hash, short_channel_id, htlc.htlc_id)
    self.sent_htlcs_routes[key] = (route, payment_secret, amount_msat, total_msat, amount_receiver_msat)
    if ((not self.channel_db) and (amount_msat != total_msat)):
        if (payment_secret not in self.sent_buckets):
            self.sent_buckets[payment_secret] = (0, 0)
        (amount_sent, amount_failed) = self.sent_buckets[payment_secret]
        amount_sent += amount_receiver_msat
        self.sent_buckets[payment_secret] = (amount_sent, amount_failed)
    util.trigger_callback('htlc_added', chan, htlc, SENT)