+ fn final_value_msat(&self) -> u64 {
+ self.last().map_or(0, |hop| hop.fee_msat)
+ }
+ fn final_cltv_expiry_delta(&self) -> u32 {
+ self.last().map_or(0, |hop| hop.cltv_expiry_delta)
+ }
+}
+impl RoutePath for &[&RouteHop] {
+ fn fee_msat(&self) -> u64 {
+ self.split_last().map(|(_, path_prefix)| path_prefix).unwrap_or(&[])
+ .iter().map(|hop| &hop.fee_msat)
+ .sum()
+ }
+ fn final_value_msat(&self) -> u64 {
+ self.last().map_or(0, |hop| hop.fee_msat)
+ }
+ fn final_cltv_expiry_delta(&self) -> u32 {
+ self.last().map_or(0, |hop| hop.cltv_expiry_delta)
+ }