X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Frouter.rs;h=140148ca354b2e6f5219d53b71795ae278adf927;hb=88821cbd0c4558452b995ef30bbb8c84f85cbe4c;hp=36550bf99b96d2948aec80fc1862ed9fccd77fa1;hpb=21b0818be7c3f4b3fce24c2bd3ac0c156549f8bc;p=rust-lightning diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 36550bf99..140148ca3 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -794,7 +794,7 @@ impl ReadableArgs for Features { } /// A list of hops along a payment path terminating with a channel to the recipient. -#[derive(Clone, Debug, Hash, Eq, PartialEq)] +#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] pub struct RouteHint(pub Vec); impl Writeable for RouteHint { @@ -819,7 +819,7 @@ impl Readable for RouteHint { } /// A channel descriptor for a hop along a payment path. -#[derive(Clone, Debug, Hash, Eq, PartialEq)] +#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] pub struct RouteHintHop { /// The node_id of the non-target end of the route pub src_node_id: PublicKey, @@ -963,7 +963,7 @@ fn max_htlc_from_capacity(capacity: EffectiveCapacity, max_channel_saturation_po EffectiveCapacity::ExactLiquidity { liquidity_msat } => liquidity_msat, EffectiveCapacity::Infinite => u64::max_value(), EffectiveCapacity::Unknown => EffectiveCapacity::Unknown.as_msat(), - EffectiveCapacity::MaximumHTLC { amount_msat } => + EffectiveCapacity::AdvertisedMaxHTLC { amount_msat } => amount_msat.checked_shr(saturation_shift).unwrap_or(0), EffectiveCapacity::Total { capacity_msat, htlc_maximum_msat } => cmp::min(capacity_msat.checked_shr(saturation_shift).unwrap_or(0), htlc_maximum_msat),