]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f - Don't serialize node id
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 13 Jan 2022 23:58:14 +0000 (17:58 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Thu, 20 Jan 2022 22:14:46 +0000 (16:14 -0600)
lightning/src/routing/scoring.rs

index 51397cdae079cbc4dd4cbaf5121d92626db21ec2..9e2f8132eeb39392eb53c06a0f598345a457dc72 100644 (file)
@@ -747,20 +747,20 @@ 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.node_id.write(w)?;
                self.channel_liquidities.write(w)?;
                write_tlv_fields!(w, {});
                Ok(())
        }
 }
 
-impl<G: Deref<Target = NetworkGraph>> ReadableArgs<G> for ProbabilisticScorer<G> {
+impl<G: Deref<Target = NetworkGraph>> ReadableArgs<(&PublicKey, G)> for ProbabilisticScorer<G> {
        #[inline]
-       fn read<R: Read>(r: &mut R, args: G) -> Result<Self, DecodeError> {
+       fn read<R: Read>(r: &mut R, args: (&PublicKey, G)) -> Result<Self, DecodeError> {
+               let (node_pubkey, network_graph) = args;
                let res = Ok(Self {
                        params: Readable::read(r)?,
-                       node_id: Readable::read(r)?,
-                       network_graph: args,
+                       node_id: NodeId::from_pubkey(node_pubkey),
+                       network_graph,
                        channel_liquidities: Readable::read(r)?,
                });
                read_tlv_fields!(r, {});