Discovery and seeding of other peers. Relies either on a gist with IP addresses or a static list. Connects to a first list, sending peer request messages to discover more. Monitor the server to make sure there's always enough peer connections.

This commit is contained in:
Ignotus Peverell
2017-02-18 18:42:34 -08:00
parent 510feadce6
commit eb024e91d2
16 changed files with 554 additions and 90 deletions
+6
View File
@@ -130,6 +130,12 @@ impl Store {
}
}
/// Whether the provided key exists
pub fn exists(&self, key: &[u8]) -> Result<bool, Error> {
let db = self.rdb.read().unwrap();
db.get(key).map(|r| r.is_some()).map_err(From::from)
}
/// Deletes a key/value pair from the db
pub fn delete(&self, key: &[u8]) -> Result<(), Error> {
let db = self.rdb.write().unwrap();