X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Fmod.rs;h=51ffd91b50483d58bc2016440bdb98d9f82886e5;hb=083828ae5f20562823b9c07390ee0f1de4c0e9a6;hp=9e72d7c3e0f6fb132ece179fe142fa0219bbe425;hpb=5bd7f24634a983326924f200bfff7c7c0fa56601;p=rust-lightning diff --git a/lightning/src/routing/mod.rs b/lightning/src/routing/mod.rs index 9e72d7c3..51ffd91b 100644 --- a/lightning/src/routing/mod.rs +++ b/lightning/src/routing/mod.rs @@ -1,3 +1,25 @@ +// This file is Copyright its original authors, visible in version control +// history. +// +// This file is licensed under the Apache License, Version 2.0 or the MIT license +// , at your option. +// You may not use this file except in accordance with one or both of these +// licenses. + //! Structs and impls for receiving messages about the network and storing the topology live here. +pub mod network_graph; pub mod router; +pub mod scorer; + +use routing::network_graph::NodeId; + +/// An interface used to score payment channels for path finding. +/// +/// Scoring is in terms of fees willing to be paid in order to avoid routing through a channel. +pub trait Score { + /// Returns the fee in msats willing to be paid to avoid routing through the given channel + /// in the direction from `source` to `target`. + fn channel_penalty_msat(&self, short_channel_id: u64, source: &NodeId, target: &NodeId) -> u64; +}