aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-29 18:30:10 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-29 18:30:10 -0700
commitfe7000123e4c7dbed458f6123a654fa9fb3c0107 (patch)
tree7d1928a385edceb0992ab9c771cefe45046d6e54 /src
parenta5894ff91da1f553419031c064671202f2c977ac (diff)
downloadgeniza-fe7000123e4c7dbed458f6123a654fa9fb3c0107.tar.gz
geniza-fe7000123e4c7dbed458f6123a654fa9fb3c0107.zip
discovery key helper on sleep dir
Diffstat (limited to 'src')
-rw-r--r--src/sleep_register.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sleep_register.rs b/src/sleep_register.rs
index 668bb62..3e1c48e 100644
--- a/src/sleep_register.rs
+++ b/src/sleep_register.rs
@@ -12,6 +12,7 @@ use rand::{OsRng, Rng};
use errors::*;
use sleep_file::*;
+use protocol::make_discovery_key;
/// Abstract access to Hypercore register
pub trait HyperRegister {
@@ -362,6 +363,10 @@ impl SleepDirRegister {
sf.check()?;
Ok(sf)
}
+
+ pub fn discovery_key(&self) -> Vec<u8> {
+ make_discovery_key(&self.pub_key)
+ }
}
impl HyperRegister for SleepDirRegister {