diff --git a/fuzz/src/router.rs b/fuzz/src/router.rs index fa1cceb8a16..593203d5be1 100644 --- a/fuzz/src/router.rs +++ b/fuzz/src/router.rs @@ -212,6 +212,8 @@ pub fn do_test(data: &[u8], out: Out) { inbound_capacity_msat: 0, is_live: true, outbound_capacity_msat: 0, + fee_base_msat: 0, + fee_proportional_millionths: 0, }); } Some(&first_hops_vec[..]) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index b56ce5d9d05..da4b88287a3 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -544,6 +544,10 @@ pub struct ChannelDetails { /// True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) /// the peer is connected, and (c) no monitor update failure is pending resolution. pub is_live: bool, + /// Fee charged by this node per transaction. + pub fee_base_msat: u32, + /// Fee charged by this node proportional to the amount routed. + pub fee_proportional_millionths: u32, } /// If a payment fails to send, it can be in one of several states. This enum is returned as the @@ -863,6 +867,8 @@ impl ChannelMana outbound_capacity_msat, user_id: channel.get_user_id(), is_live: channel.is_live(), + fee_base_msat: channel.get_holder_fee_base_msat(&self.fee_estimator), + fee_proportional_millionths: channel.get_fee_proportional_millionths(), }); } } diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 7819b06c027..5de76201915 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -1443,6 +1443,8 @@ mod tests { outbound_capacity_msat: 100000, inbound_capacity_msat: 100000, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; if let Err(LightningError{err, action: ErrorAction::IgnoreError}) = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], Some(&our_chans.iter().collect::>()), &Vec::new(), 100, 42, Arc::clone(&logger)) { @@ -1757,6 +1759,8 @@ mod tests { outbound_capacity_msat: 250_000_000, inbound_capacity_msat: 0, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], Some(&our_chans.iter().collect::>()), &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap(); assert_eq!(route.paths[0].len(), 2); @@ -1804,6 +1808,8 @@ mod tests { outbound_capacity_msat: 250_000_000, inbound_capacity_msat: 0, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], Some(&our_chans.iter().collect::>()), &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap(); assert_eq!(route.paths[0].len(), 2); @@ -1868,6 +1874,8 @@ mod tests { outbound_capacity_msat: 250_000_000, inbound_capacity_msat: 0, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2], Some(&our_chans.iter().collect::>()), &Vec::new(), 100, 42, Arc::clone(&logger)).unwrap(); assert_eq!(route.paths[0].len(), 2); @@ -2004,6 +2012,8 @@ mod tests { outbound_capacity_msat: 250_000_000, inbound_capacity_msat: 0, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; let mut last_hops = last_hops(&nodes); let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[6], Some(&our_chans.iter().collect::>()), &last_hops.iter().collect::>(), 100, 42, Arc::clone(&logger)).unwrap(); @@ -2132,6 +2142,8 @@ mod tests { outbound_capacity_msat: 100000, inbound_capacity_msat: 100000, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; let route = get_route(&source_node_id, &NetworkGraph::new(genesis_block(Network::Testnet).header.block_hash()), &target_node_id, Some(&our_chans.iter().collect::>()), &last_hops.iter().collect::>(), 100, 42, Arc::new(test_utils::TestLogger::new())).unwrap(); @@ -2261,6 +2273,8 @@ mod tests { outbound_capacity_msat: 200_000_000, inbound_capacity_msat: 0, is_live: true, + fee_base_msat: 0, + fee_proportional_millionths: 0, }]; {