]> git.bitcoin.ninja Git - dnsseed-rust/commitdiff
Add some basic COMPACT_FILTERS support
authorMatt Corallo <git@bluematt.me>
Mon, 2 Dec 2019 19:55:06 +0000 (14:55 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 2 Dec 2019 19:55:06 +0000 (14:55 -0500)
src/datastore.rs

index 840863aed4d966988d370f63bdc5a3ecc3742919..829fe0e1e7c7e9871b91af4da328636bc50a6e89 100644 (file)
@@ -486,7 +486,28 @@ impl Store {
                        let mut dns_buff = String::new();
                        {
                                let mut rng = thread_rng();
-                               for i in &[1u64, 4, 5, 8, 9, 12, 13, 1024, 1025, 1028, 1029, 1032, 1033, 1036, 1037] {
+                               for i in &[ 0b00000000001u64,
+                                           0b00000000100,
+                                           0b00000000101,
+                                           0b00000001000,
+                                           0b00000001001,
+                                           0b00000001100,
+                                           0b00000001101,
+                                           0b00001001001,
+                                           0b10000000000,
+                                           0b10000000001,
+                                           0b10000000100,
+                                           0b10000000101,
+                                           0b10000001000,
+                                           0b10000001001,
+                                           0b10000001100,
+                                           0b10000001101,
+                                           0b10001001000] {
+                               //            ^ NODE_NETWORK_LIIMTED
+                               //COMPACT_FILTERS ^   ^ NODE_BLOOM
+                               //      NODE_WITNESS ^  ^ NODE_NETWORK
+                               // We support all combos of NETWORK, NETWORK_LIMITED, BLOOM, and WITNESS
+                               // We support COMPACT_FILTERS with WITNESS and NETWORK or NETWORK_LIIMTED.
                                        let mut tor_set: Vec<Ipv6Addr> = Vec::new();
                                        let mut v6_set: Vec<Ipv6Addr> = Vec::new();
                                        let mut v4_set: Vec<Ipv4Addr> = Vec::new();