]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Update LDK to 0.0.112
authorMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 18:01:37 +0000 (18:01 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 18:01:37 +0000 (18:01 +0000)
Cargo.toml
src/downloader.rs
src/lib.rs
src/persistence.rs
src/verifier.rs

index 79fa1d75d7c08a89bf94650e4f7fba85684a42e3..852c7c2c2ac62adffbc1ce381408cf96ff38619a 100644 (file)
@@ -5,9 +5,9 @@ edition = "2018"
 
 [dependencies]
 bitcoin = "0.29"
-lightning = { version = "0.0.111" }
-lightning-block-sync = { version = "0.0.111", features=["rest-client"] }
-lightning-net-tokio = { version = "0.0.111" }
+lightning = { version = "0.0.112" }
+lightning-block-sync = { version = "0.0.112", features=["rest-client"] }
+lightning-net-tokio = { version = "0.0.112" }
 tokio = { version = "1.14.1", features = ["full"] }
 tokio-postgres = { version="0.7.5" }
 futures = "0.3"
index 504db2a4ec4b2eb91595fa112e7227ee27be1543..4fc3d51c6c005f610af7680af999068747c54a04 100644 (file)
@@ -106,7 +106,7 @@ impl RoutingMessageHandler for GossipRouter {
                self.native_router.get_next_node_announcement(starting_point)
        }
 
-       fn peer_connected(&self, their_node_id: &PublicKey, init: &Init) {
+       fn peer_connected(&self, their_node_id: &PublicKey, init: &Init) -> Result<(), ()> {
                self.native_router.peer_connected(their_node_id, init)
        }
 
index 01bc57081e473c1061f93a50f5e6e42848deb802..bf61b40408db7e192604e5fe051a2ee22a56a9f2 100644 (file)
@@ -60,7 +60,7 @@ impl RapidSyncProcessor {
                        let mut buffered_reader = BufReader::new(file);
                        let network_graph_result = NetworkGraph::read(&mut buffered_reader, logger);
                        if let Ok(network_graph) = network_graph_result {
-                               network_graph.remove_stale_channels();
+                               network_graph.remove_stale_channels_and_tracking();
                                println!("Initialized from cached network graph!");
                                network_graph
                        } else {
index 51c242b7c8e94fab862fc305e8558e23cde719f7..99fab327c932c101157f2eec3ee21fe1aeed87e8 100644 (file)
@@ -189,7 +189,7 @@ impl GossipPersister {
                        .truncate(true)
                        .open(&cache_path)
                        .unwrap();
-               self.network_graph.remove_stale_channels();
+               self.network_graph.remove_stale_channels_and_tracking();
                let mut writer = BufWriter::new(file);
                self.network_graph.write(&mut writer).unwrap();
                writer.flush().unwrap();
index 46c87096bdd80fdafda936f5f1ca83ac20161ad6..62c191a3ce2727d9930e06b0ca58425408753dfe 100644 (file)
@@ -5,7 +5,7 @@ use bitcoin::blockdata::block::Block;
 use bitcoin::hashes::Hash;
 use lightning::chain;
 use lightning::chain::AccessError;
-use lightning_block_sync::BlockSource;
+use lightning_block_sync::{BlockData, BlockSource};
 use lightning_block_sync::http::BinaryResponse;
 use lightning_block_sync::rest::RestClient;
 
@@ -36,11 +36,16 @@ impl ChainVerifier {
                        let block_hash = BlockHash::from_slice(&block_hash).unwrap();
 
                        let block_result = self.rest_client.get_block(&block_hash).await;
-                       let block = block_result.map_err(|error| {
-                               eprintln!("Couldn't retrieve block {}: {:?} ({})", block_height, error, block_hash);
-                               AccessError::UnknownChain
-                       })?;
-                       Ok(block)
+                       match block_result {
+                               Ok(BlockData::FullBlock(block)) => {
+                                       Ok(block)
+                               },
+                               Ok(_) => unreachable!(),
+                               Err(error) => {
+                                       eprintln!("Couldn't retrieve block {}: {:?} ({})", block_height, error, block_hash);
+                                       Err(AccessError::UnknownChain)
+                               }
+                       }
                }) })
        }
 }