X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Frouter.rs;fp=lightning%2Fsrc%2Frouting%2Frouter.rs;h=dd5cadecc8322e88b56d369004cbde5a85e47e66;hb=99ecd02f7d5dbf1d53eb59b7e3ef90e87441193d;hp=548febbd470d440dd39e4f2b6f049c3ce7c3a214;hpb=41d8d4d6b277b7919ea847ffcfcaea59471ba4ff;p=rust-lightning diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 548febbd4..dd5cadecc 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -882,7 +882,11 @@ pub fn get_route(our_node_id: &PublicKey, network: &NetworkGraph, paye htlc_maximum_msat: hop.htlc_maximum_msat, fees: hop.fees, }; - if add_entry!(hop.short_channel_id, hop.src_node_id, payee, directional_info, None::, &empty_channel_features, 0, path_value_msat, 0) { + // We assume that the recipient only included route hints for routes which had + // sufficient value to route `final_value_msat`. Note that in the case of "0-value" + // invoices where the invoice does not specify value this may not be the case, but + // better to include the hints than not. + if add_entry!(hop.short_channel_id, hop.src_node_id, payee, directional_info, Some((final_value_msat + 999) / 1000), &empty_channel_features, 0, path_value_msat, 0) { // If this hop connects to a node with which we have a direct channel, // ignore the network graph and, if the last hop was added, add our // direct channel to the candidate set.