]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Correct error-matching in downloader
authorMatt Corallo <git@bluematt.me>
Mon, 22 Aug 2022 03:24:27 +0000 (03:24 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 22 Aug 2022 17:07:39 +0000 (17:07 +0000)
src/downloader.rs

index 3e6f91e051881b49ea516b94b45c32c9dc506441..6bfaa14903b8e5f73e0154648f4bafa9f55cb3c4 100644 (file)
@@ -60,11 +60,9 @@ impl RoutingMessageHandler for GossipRouter {
                let mut counter = self.counter.write().unwrap();
 
                let output_value = self.native_router.handle_channel_announcement(msg).map_err(|error| {
-                       let error_string = format!("{:?}", error);
-                       if error_string.contains("announced on an unknown chain"){
-                               return error;
+                       if error.err.contains("didn't match on-chain script") {
+                               counter.channel_announcements_with_mismatched_scripts += 1;
                        }
-                       counter.channel_announcements_with_mismatched_scripts += 1;
                        error
                })?;