Merge pull request #46 from TheBlueMatt/2022-03-0.0.105
authorvalentinewallace <valentinewallace@users.noreply.github.com>
Thu, 10 Mar 2022 21:11:40 +0000 (16:11 -0500)
committerGitHub <noreply@github.com>
Thu, 10 Mar 2022 21:11:40 +0000 (16:11 -0500)
Update to LDK 0.0.105

Cargo.lock
Cargo.toml
src/cli.rs
src/disk.rs
src/main.rs

index 5c5b67e23f28e395d1584d21ea7cf7202fe0b660..f7f1ee463a8b412b5a529309fe1b23a2c93a29df 100644 (file)
@@ -4,9 +4,9 @@ version = 3
 
 [[package]]
 name = "autocfg"
-version = "1.0.1"
+version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
 
 [[package]]
 name = "base64"
@@ -54,9 +54,9 @@ checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
 
 [[package]]
 name = "cc"
-version = "1.0.72"
+version = "1.0.73"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
+checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
 
 [[package]]
 name = "cfg-if"
@@ -91,9 +91,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
 
 [[package]]
 name = "futures"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
+checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e"
 dependencies = [
  "futures-channel",
  "futures-core",
@@ -106,9 +106,9 @@ dependencies = [
 
 [[package]]
 name = "futures-channel"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b"
+checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010"
 dependencies = [
  "futures-core",
  "futures-sink",
@@ -116,15 +116,15 @@ dependencies = [
 
 [[package]]
 name = "futures-core"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"
+checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3"
 
 [[package]]
 name = "futures-executor"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
+checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6"
 dependencies = [
  "futures-core",
  "futures-task",
@@ -133,15 +133,15 @@ dependencies = [
 
 [[package]]
 name = "futures-io"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
+checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b"
 
 [[package]]
 name = "futures-macro"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
+checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -150,21 +150,21 @@ dependencies = [
 
 [[package]]
 name = "futures-sink"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508"
+checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868"
 
 [[package]]
 name = "futures-task"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72"
+checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a"
 
 [[package]]
 name = "futures-util"
-version = "0.3.19"
+version = "0.3.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164"
+checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a"
 dependencies = [
  "futures-channel",
  "futures-core",
@@ -223,15 +223,15 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.112"
+version = "0.2.119"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
+checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
 
 [[package]]
 name = "lightning"
-version = "0.0.104"
+version = "0.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0113e6b5a55b7ead30fb0a992b787e69a0551fa15b7eed93c99490eb018ab793"
+checksum = "a10e7439623b293d000fc875627704210d8d0ff5b7badbb689f2a3d51afc618f"
 dependencies = [
  "bitcoin",
  "secp256k1",
@@ -239,9 +239,9 @@ dependencies = [
 
 [[package]]
 name = "lightning-background-processor"
-version = "0.0.104"
+version = "0.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fe8419b773e4f212faa21bf7fe493746aeb69284d396a263215c3a4131a0a5f"
+checksum = "867b488afcffe0e86f0f9d35212e133125441b226ba4d48b4f304fb898984eed"
 dependencies = [
  "bitcoin",
  "lightning",
@@ -250,9 +250,9 @@ dependencies = [
 
 [[package]]
 name = "lightning-block-sync"
-version = "0.0.104"
+version = "0.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54d54f17ce6a62b118fb4ebcbd81da267e6dc76c6fe7af2cdc9e47d8d99ef28a"
+checksum = "fa2927b07431cabdfb07b130032bd78c6557d80bd054be749e4824308e6f29fd"
 dependencies = [
  "bitcoin",
  "chunked_transfer",
@@ -263,9 +263,9 @@ dependencies = [
 
 [[package]]
 name = "lightning-invoice"
-version = "0.12.0"
+version = "0.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2531e38818b3872b9acbcc3ff499f93962d2ff23ee0d05fc386ef70b993a38a0"
+checksum = "ce661ad7182c2b258d1506e264095d2b4c71436a91b72834d7fb87b7e92e06c0"
 dependencies = [
  "bech32",
  "bitcoin_hashes",
@@ -276,9 +276,9 @@ dependencies = [
 
 [[package]]
 name = "lightning-net-tokio"
-version = "0.0.104"
+version = "0.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1851ab90c2739929526c56e06d6b07def4508bfce70f190757fde2de648d1d9c"
+checksum = "e6eb1bcdf0a29baccb13d514e4a8761c9d8038ffd107f27e45182f0177f5e007"
 dependencies = [
  "bitcoin",
  "lightning",
@@ -287,9 +287,9 @@ dependencies = [
 
 [[package]]
 name = "lightning-persister"
-version = "0.0.104"
+version = "0.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cf5f42ec139dd1c878b5dc66a055a0e7d805b2db83de2a4645af3fe59e4b6af"
+checksum = "77150d61ceea59c6ee1598f26f4f9589935fe464d530f44d3d54ccc31b060512"
 dependencies = [
  "bitcoin",
  "libc",
@@ -314,9 +314,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
 
 [[package]]
 name = "mio"
-version = "0.7.14"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc"
+checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2"
 dependencies = [
  "libc",
  "log",
@@ -336,9 +336,9 @@ dependencies = [
 
 [[package]]
 name = "ntapi"
-version = "0.3.6"
+version = "0.3.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
+checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
 dependencies = [
  "winapi",
 ]
@@ -364,9 +364,9 @@ dependencies = [
 
 [[package]]
 name = "num_cpus"
-version = "1.13.0"
+version = "1.13.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
+checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
 dependencies = [
  "hermit-abi",
  "libc",
@@ -374,9 +374,9 @@ dependencies = [
 
 [[package]]
 name = "pin-project-lite"
-version = "0.2.7"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
+checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
 
 [[package]]
 name = "pin-utils"
@@ -386,18 +386,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.34"
+version = "1.0.36"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1"
+checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
 dependencies = [
  "unicode-xid",
 ]
 
 [[package]]
 name = "quote"
-version = "1.0.10"
+version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
+checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
 dependencies = [
  "proc-macro2",
 ]
@@ -456,27 +456,27 @@ dependencies = [
 
 [[package]]
 name = "secp256k1-sys"
-version = "0.4.1"
+version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "827cb7cce42533829c792fc51b82fbf18b125b45a702ef2c8be77fce65463a7b"
+checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036"
 dependencies = [
  "cc",
 ]
 
 [[package]]
 name = "serde"
-version = "1.0.132"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008"
+checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.132"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276"
+checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -485,9 +485,9 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.73"
+version = "1.0.79"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5"
+checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
 dependencies = [
  "itoa",
  "ryu",
@@ -500,11 +500,21 @@ version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
 
+[[package]]
+name = "socket2"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
 [[package]]
 name = "syn"
-version = "1.0.82"
+version = "1.0.86"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
+checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -524,9 +534,9 @@ dependencies = [
 
 [[package]]
 name = "tokio"
-version = "1.15.0"
+version = "1.17.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838"
+checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee"
 dependencies = [
  "bytes",
  "libc",
@@ -534,6 +544,7 @@ dependencies = [
  "mio",
  "num_cpus",
  "pin-project-lite",
+ "socket2",
  "tokio-macros",
  "winapi",
 ]
index 6a1546a3083f8fc2f64aab8f5ff3047c44ec407b..8e3fe5af8d8d1181f4cd54a99d8cf589d72d8d04 100644 (file)
@@ -8,12 +8,12 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-lightning = { version = "0.0.104", features = ["max_level_trace"] }
-lightning-block-sync = { version = "0.0.104", features = [ "rpc-client" ] }
-lightning-invoice = { version = "0.12.0" }
-lightning-net-tokio = { version = "0.0.104" }
-lightning-persister = { version = "0.0.104" }
-lightning-background-processor = { version = "0.0.104" }
+lightning = { version = "0.0.105", features = ["max_level_trace"] }
+lightning-block-sync = { version = "0.0.105", features = [ "rpc-client" ] }
+lightning-invoice = { version = "0.13" }
+lightning-net-tokio = { version = "0.0.105" }
+lightning-persister = { version = "0.0.105" }
+lightning-background-processor = { version = "0.0.105" }
 
 base64 = "0.13.0"
 bitcoin = "0.27"
@@ -25,7 +25,7 @@ futures = "0.3"
 chrono = "0.4"
 rand = "0.4"
 serde_json = { version = "1.0" }
-tokio = { version = "1.5", features = [ "io-util", "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] }
+tokio = { version = "1", features = [ "io-util", "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] }
 
 [profile.release]
 panic = "abort"
index a167027f5a85d3de4a70040a6a30db575900d64e..c7dffd280b3bbc3a74119bd09f1dd9ec669ed809 100644 (file)
@@ -8,7 +8,7 @@ use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::hashes::Hash;
 use bitcoin::network::constants::Network;
 use bitcoin::secp256k1::key::PublicKey;
-use lightning::chain::keysinterface::{KeysInterface, KeysManager};
+use lightning::chain::keysinterface::{KeysInterface, KeysManager, Recipient};
 use lightning::ln::msgs::NetAddress;
 use lightning::ln::{PaymentHash, PaymentPreimage};
 use lightning::util::config::{ChannelConfig, ChannelHandshakeLimits, UserConfig};
@@ -355,7 +355,7 @@ pub(crate) async fn poll_for_user_input<E: EventHandler>(
                                                "{:?}",
                                                lightning::util::message_signing::sign(
                                                        &line.as_bytes()[MSG_STARTPOS..],
-                                                       &keys_manager.get_node_secret()
+                                                       &keys_manager.get_node_secret(Recipient::Node).unwrap()
                                                )
                                        );
                                }
index b019626440b6e80e9703d4e5de87d57658cd055a..af565bc5b8afac37e05c43bb2e6f2ce855800f47 100644 (file)
@@ -3,15 +3,16 @@ use bitcoin::secp256k1::key::PublicKey;
 use bitcoin::BlockHash;
 use chrono::Utc;
 use lightning::routing::network_graph::NetworkGraph;
-use lightning::routing::scoring::Scorer;
+use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringParameters};
 use lightning::util::logger::{Logger, Record};
-use lightning::util::ser::{Readable, Writeable, Writer};
+use lightning::util::ser::{Readable, ReadableArgs, Writeable, Writer};
 use std::collections::HashMap;
 use std::fs;
 use std::fs::File;
 use std::io::{BufRead, BufReader, BufWriter};
 use std::net::SocketAddr;
 use std::path::Path;
+use std::sync::Arc;
 
 pub(crate) struct FilesystemLogger {
        data_dir: String,
@@ -94,7 +95,9 @@ pub(crate) fn read_network(path: &Path, genesis_hash: BlockHash) -> NetworkGraph
        NetworkGraph::new(genesis_hash)
 }
 
-pub(crate) fn persist_scorer(path: &Path, scorer: &Scorer) -> std::io::Result<()> {
+pub(crate) fn persist_scorer(
+       path: &Path, scorer: &ProbabilisticScorer<Arc<NetworkGraph>>,
+) -> std::io::Result<()> {
        let mut tmp_path = path.to_path_buf().into_os_string();
        tmp_path.push(".tmp");
        let file = fs::OpenOptions::new().write(true).create(true).open(&tmp_path)?;
@@ -107,11 +110,16 @@ pub(crate) fn persist_scorer(path: &Path, scorer: &Scorer) -> std::io::Result<()
        }
 }
 
-pub(crate) fn read_scorer(path: &Path) -> Scorer {
+pub(crate) fn read_scorer(
+       path: &Path, graph: Arc<NetworkGraph>,
+) -> ProbabilisticScorer<Arc<NetworkGraph>> {
+       let params = ProbabilisticScoringParameters::default();
        if let Ok(file) = File::open(path) {
-               if let Ok(scorer) = Scorer::read(&mut BufReader::new(file)) {
+               if let Ok(scorer) =
+                       ProbabilisticScorer::read(&mut BufReader::new(file), (params, Arc::clone(&graph)))
+               {
                        return scorer;
                }
        }
-       Scorer::default()
+       ProbabilisticScorer::new(params, graph)
 }
index 0e18bc03c52af47596608488bbad4cfe807263a4..cdbb178a5f82b64fe3c60ec196176045137badef 100644 (file)
@@ -16,7 +16,7 @@ use bitcoin_bech32::WitnessProgram;
 use lightning::chain;
 use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
 use lightning::chain::chainmonitor;
-use lightning::chain::keysinterface::{InMemorySigner, KeysInterface, KeysManager};
+use lightning::chain::keysinterface::{InMemorySigner, KeysInterface, KeysManager, Recipient};
 use lightning::chain::{BestBlock, Filter, Watch};
 use lightning::ln::channelmanager;
 use lightning::ln::channelmanager::{
@@ -25,7 +25,7 @@ use lightning::ln::channelmanager::{
 use lightning::ln::peer_handler::{IgnoringMessageHandler, MessageHandler, SimpleArcPeerManager};
 use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
 use lightning::routing::network_graph::{NetGraphMsgHandler, NetworkGraph};
-use lightning::routing::scoring::Scorer;
+use lightning::routing::scoring::ProbabilisticScorer;
 use lightning::util::config::UserConfig;
 use lightning::util::events::{Event, PaymentPurpose};
 use lightning::util::ser::ReadableArgs;
@@ -101,7 +101,7 @@ pub(crate) type ChannelManager =
 pub(crate) type InvoicePayer<E> = payment::InvoicePayer<
        Arc<ChannelManager>,
        Router,
-       Arc<Mutex<Scorer>>,
+       Arc<Mutex<ProbabilisticScorer<Arc<NetworkGraph>>>>,
        Arc<FilesystemLogger>,
        E,
 >;
@@ -218,6 +218,9 @@ async fn handle_ldk_events(
                                }
                        }
                }
+               Event::OpenChannelRequest { .. } => {
+                       // Unreachable, we don't set manually_accept_inbound_channels
+               }
                Event::PaymentPathSuccessful { .. } => {}
                Event::PaymentPathFailed { .. } => {}
                Event::PaymentFailed { payment_hash, .. } => {
@@ -397,7 +400,7 @@ async fn start_ldk() {
        let mut user_config = UserConfig::default();
        user_config.peer_channel_config_limits.force_announced_channel_preference = false;
        let mut restarting_node = true;
-       let (channel_manager_blockhash, mut channel_manager) = {
+       let (channel_manager_blockhash, channel_manager) = {
                if let Ok(mut f) = fs::File::open(format!("{}/manager", ldk_data_dir.clone())) {
                        let mut channel_monitor_mut_references = Vec::new();
                        for (_, channel_monitor) in channelmonitors.iter_mut() {
@@ -444,7 +447,7 @@ async fn start_ldk() {
        let mut chain_tip: Option<poll::ValidatedBlockHeader> = None;
        if restarting_node {
                let mut chain_listeners =
-                       vec![(channel_manager_blockhash, &mut channel_manager as &mut dyn chain::Listen)];
+                       vec![(channel_manager_blockhash, &channel_manager as &dyn chain::Listen)];
 
                for (blockhash, channel_monitor) in channelmonitors.drain(..) {
                        let outpoint = channel_monitor.get_funding_txo().0;
@@ -456,10 +459,8 @@ async fn start_ldk() {
                }
 
                for monitor_listener_info in chain_listener_channel_monitors.iter_mut() {
-                       chain_listeners.push((
-                               monitor_listener_info.0,
-                               &mut monitor_listener_info.1 as &mut dyn chain::Listen,
-                       ));
+                       chain_listeners
+                               .push((monitor_listener_info.0, &monitor_listener_info.1 as &dyn chain::Listen));
                }
                chain_tip = Some(
                        init::synchronize_listeners(
@@ -516,7 +517,7 @@ async fn start_ldk() {
        };
        let peer_manager: Arc<PeerManager> = Arc::new(PeerManager::new(
                lightning_msg_handler,
-               keys_manager.get_node_secret(),
+               keys_manager.get_node_secret(Recipient::Node).unwrap(),
                &ephemeral_bytes,
                logger.clone(),
                Arc::new(IgnoringMessageHandler {}),
@@ -588,9 +589,12 @@ async fn start_ldk() {
                ));
        };
 
-       // Step 16: Initialize routing Scorer
-       let scorer_path = format!("{}/scorer", ldk_data_dir.clone());
-       let scorer = Arc::new(Mutex::new(disk::read_scorer(Path::new(&scorer_path))));
+       // Step 16: Initialize routing ProbabilisticScorer
+       let scorer_path = format!("{}/prob_scorer", ldk_data_dir.clone());
+       let scorer = Arc::new(Mutex::new(disk::read_scorer(
+               Path::new(&scorer_path),
+               Arc::clone(&network_graph),
+       )));
        let scorer_persist = Arc::clone(&scorer);
        tokio::spawn(async move {
                let mut interval = tokio::time::interval(Duration::from_secs(600));