]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f - Don't serialize ProbabilisticScoringParameters
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 27 Jan 2022 16:44:38 +0000 (10:44 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 2 Feb 2022 16:33:47 +0000 (10:33 -0600)
lightning/src/routing/scoring.rs

index 82e52755c8f9ad0fa3f92addbe8741852973ef65..100363b689ce5a4e1f87e86e69fa6739082b9aa6 100644 (file)
@@ -738,19 +738,21 @@ impl<G: Deref<Target = NetworkGraph>> Score for ProbabilisticScorer<G> {
 impl<G: Deref<Target = NetworkGraph>> Writeable for ProbabilisticScorer<G> {
        #[inline]
        fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
-               self.params.write(w)?;
                self.channel_liquidities.write(w)?;
                write_tlv_fields!(w, {});
                Ok(())
        }
 }
 
-impl<G: Deref<Target = NetworkGraph>> ReadableArgs<(&PublicKey, G)> for ProbabilisticScorer<G> {
+impl<G: Deref<Target = NetworkGraph>> ReadableArgs<(ProbabilisticScoringParameters, &PublicKey, G)>
+for ProbabilisticScorer<G> {
        #[inline]
-       fn read<R: Read>(r: &mut R, args: (&PublicKey, G)) -> Result<Self, DecodeError> {
-               let (node_pubkey, network_graph) = args;
+       fn read<R: Read>(
+               r: &mut R, args: (ProbabilisticScoringParameters, &PublicKey, G)
+       ) -> Result<Self, DecodeError> {
+               let (params, node_pubkey, network_graph) = args;
                let res = Ok(Self {
-                       params: Readable::read(r)?,
+                       params,
                        node_id: NodeId::from_pubkey(node_pubkey),
                        network_graph,
                        channel_liquidities: Readable::read(r)?,