Share events with own family by default, instead of all known peers. Relates to #5
This commit is contained in:
parent
6581c3b9c6
commit
4381cc82cb
5 changed files with 121 additions and 24 deletions
|
@ -1,4 +1,4 @@
|
|||
use anyhow::bail;
|
||||
use anyhow::{anyhow, bail};
|
||||
use i2p::net::{I2pAddr, I2pSocketAddr, ToI2pSocketAddrs};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -11,6 +11,12 @@ impl PeerId {
|
|||
pub fn addr(&self) -> I2pSocketAddr {
|
||||
self.i2p_addr.to_owned()
|
||||
}
|
||||
pub fn addr_ref(&self) -> &I2pSocketAddr {
|
||||
&self.i2p_addr
|
||||
}
|
||||
pub fn b32_addr(&self) -> anyhow::Result<I2pAddr> {
|
||||
I2pAddr::from_b64(&self.i2p_addr.dest().string()).map_err(|e| anyhow!(e))
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for PeerId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue