X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Fscoring.rs;h=31158d41bc37570b7f95a98b5fb48bb9b68ea52d;hb=06f09eeafcc1a820d6f71b00714618191082a8ef;hp=f16dd2d5b401e521c7299cfa3e2b647cb9d105ab;hpb=1fd95496d1038352535a74065d2b06559e2192fb;p=rust-lightning diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index f16dd2d5..31158d41 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -260,7 +260,7 @@ impl<'a, S: Writeable> Writeable for MutexGuard<'a, S> { } /// Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`]. -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub struct ChannelUsage { /// The amount to send through the channel, denominated in millisatoshis. pub amount_msat: u64, @@ -1759,8 +1759,7 @@ mod tests { } fn network_graph(logger: &TestLogger) -> NetworkGraph<&TestLogger> { - let genesis_hash = genesis_block(Network::Testnet).header.block_hash(); - let mut network_graph = NetworkGraph::new(genesis_hash, logger); + let mut network_graph = NetworkGraph::new(Network::Testnet, logger); add_channel(&mut network_graph, 42, source_privkey(), target_privkey()); add_channel(&mut network_graph, 43, target_privkey(), recipient_privkey()); @@ -2226,8 +2225,7 @@ mod tests { // we do not score such channels. let secp_ctx = Secp256k1::new(); let logger = TestLogger::new(); - let genesis_hash = genesis_block(Network::Testnet).header.block_hash(); - let mut network_graph = NetworkGraph::new(genesis_hash, &logger); + let mut network_graph = NetworkGraph::new(Network::Testnet, &logger); let secret_a = SecretKey::from_slice(&[42; 32]).unwrap(); let secret_b = SecretKey::from_slice(&[43; 32]).unwrap(); let secret_c = SecretKey::from_slice(&[44; 32]).unwrap();