Struct bdk::blockchain::compact_filters::Peer
source · [−]pub struct Peer { /* private fields */ }
compact_filters
only.Expand description
A Bitcoin peer
Implementations
pub fn connect<A: ToSocketAddrs>(
address: A,
mempool: Arc<Mempool>,
network: Network
) -> Result<Self, CompactFiltersError>
pub fn connect<A: ToSocketAddrs>(
address: A,
mempool: Arc<Mempool>,
network: Network
) -> Result<Self, CompactFiltersError>
Connect to a peer over a plaintext TCP connection
This function internally spawns a new thread that will monitor incoming messages from the peer, and optionally reply to some of them transparently, like pings
pub fn connect_proxy<T: ToTargetAddr, P: ToSocketAddrs>(
target: T,
proxy: P,
credentials: Option<(&str, &str)>,
mempool: Arc<Mempool>,
network: Network
) -> Result<Self, CompactFiltersError>
pub fn connect_proxy<T: ToTargetAddr, P: ToSocketAddrs>(
target: T,
proxy: P,
credentials: Option<(&str, &str)>,
mempool: Arc<Mempool>,
network: Network
) -> Result<Self, CompactFiltersError>
Connect to a peer through a SOCKS5 proxy, optionally by using some credentials, specified
as a tuple of (username, password)
This function internally spawns a new thread that will monitor incoming messages from the peer, and optionally reply to some of them transparently, like pings
Return the VersionMessage
sent by the peer
Return the Bitcoin Network
in use
Return the mempool used by this peer
Return whether or not the peer is still connected
Send a raw Bitcoin message to the peer
pub fn recv(
&self,
wait_for: &'static str,
timeout: Option<Duration>
) -> Result<Option<NetworkMessage>, CompactFiltersError>
pub fn recv(
&self,
wait_for: &'static str,
timeout: Option<Duration>
) -> Result<Option<NetworkMessage>, CompactFiltersError>
Waits for a specific incoming Bitcoin message, optionally with a timeout