|
|
@ -945,7 +945,8 @@ class LNWallet(LNWorker): |
|
|
|
if not peer: |
|
|
|
raise Exception('Dropped peer') |
|
|
|
await peer.initialized |
|
|
|
htlc = peer.pay(route=route, |
|
|
|
htlc = peer.pay( |
|
|
|
route=route, |
|
|
|
chan=chan, |
|
|
|
amount_msat=lnaddr.get_amount_msat(), |
|
|
|
payment_hash=lnaddr.paymenthash, |
|
|
@ -1095,12 +1096,14 @@ class LNWallet(LNWorker): |
|
|
|
path = full_path[:-len(private_route)] |
|
|
|
else: |
|
|
|
# find path now on public graph, to border node |
|
|
|
path = self.network.path_finder.find_path_for_payment(self.node_keypair.pubkey, border_node_pubkey, amount_msat, |
|
|
|
path = self.network.path_finder.find_path_for_payment( |
|
|
|
self.node_keypair.pubkey, border_node_pubkey, amount_msat, |
|
|
|
my_channels=scid_to_my_channels) |
|
|
|
if not path: |
|
|
|
continue |
|
|
|
try: |
|
|
|
route = self.network.path_finder.create_route_from_path(path, self.node_keypair.pubkey, |
|
|
|
route = self.network.path_finder.create_route_from_path( |
|
|
|
path, self.node_keypair.pubkey, |
|
|
|
my_channels=scid_to_my_channels) |
|
|
|
except NoChannelPolicy: |
|
|
|
continue |
|
|
@ -1113,7 +1116,8 @@ class LNWallet(LNWorker): |
|
|
|
short_channel_id = ShortChannelID(short_channel_id) |
|
|
|
# if we have a routing policy for this edge in the db, that takes precedence, |
|
|
|
# as it is likely from a previous failure |
|
|
|
channel_policy = self.channel_db.get_policy_for_node(short_channel_id=short_channel_id, |
|
|
|
channel_policy = self.channel_db.get_policy_for_node( |
|
|
|
short_channel_id=short_channel_id, |
|
|
|
node_id=prev_node_id, |
|
|
|
my_channels=scid_to_my_channels) |
|
|
|
if channel_policy: |
|
|
@ -1121,7 +1125,9 @@ class LNWallet(LNWorker): |
|
|
|
fee_proportional_millionths = channel_policy.fee_proportional_millionths |
|
|
|
cltv_expiry_delta = channel_policy.cltv_expiry_delta |
|
|
|
node_info = self.channel_db.get_node_info_for_node_id(node_id=node_pubkey) |
|
|
|
route.append(RouteEdge(node_id=node_pubkey, |
|
|
|
route.append( |
|
|
|
RouteEdge( |
|
|
|
node_id=node_pubkey, |
|
|
|
short_channel_id=short_channel_id, |
|
|
|
fee_base_msat=fee_base_msat, |
|
|
|
fee_proportional_millionths=fee_proportional_millionths, |
|
|
@ -1139,11 +1145,13 @@ class LNWallet(LNWorker): |
|
|
|
if full_path: # user pre-selected path |
|
|
|
path = full_path |
|
|
|
else: # find path now |
|
|
|
path = self.network.path_finder.find_path_for_payment(self.node_keypair.pubkey, invoice_pubkey, amount_msat, |
|
|
|
path = self.network.path_finder.find_path_for_payment( |
|
|
|
self.node_keypair.pubkey, invoice_pubkey, amount_msat, |
|
|
|
my_channels=scid_to_my_channels) |
|
|
|
if not path: |
|
|
|
raise NoPathFound() |
|
|
|
route = self.network.path_finder.create_route_from_path(path, self.node_keypair.pubkey, |
|
|
|
route = self.network.path_finder.create_route_from_path( |
|
|
|
path, self.node_keypair.pubkey, |
|
|
|
my_channels=scid_to_my_channels) |
|
|
|
if not is_route_sane_to_use(route, amount_msat, decoded_invoice.get_min_final_cltv_expiry()): |
|
|
|
self.logger.info(f"rejecting insane route {route}") |
|
|
|