Merge rust-bitcoin/rust-bitcoin#2341: p2p: Improve nonce documentation
de9c2bc43d
p2p: Improve nonce documentation (Tobin C. Harding) Pull request description: Better describe what the nonce is used for. Note this file has not had its docs manicured so the line length is 80 still, just use the same line length instead of the conventional 100. Fix: #575 ACKs for top commit: Kixunil: ACKde9c2bc43d
apoelstra: ACKde9c2bc43d
Tree-SHA512: ab18d9893fff4e673373125e607a4a60843a98cf84dc336fba9b6423da24ea3ad4c5fe5846ae8bcef51962dc2f3017157f2d7301c2c2cd1a81a37c3da6823552
This commit is contained in:
commit
4c9553481c
|
@ -32,6 +32,13 @@ pub struct VersionMessage {
|
||||||
/// The network address of the peer sending the message
|
/// The network address of the peer sending the message
|
||||||
pub sender: Address,
|
pub sender: Address,
|
||||||
/// A random nonce used to detect loops in the network
|
/// A random nonce used to detect loops in the network
|
||||||
|
///
|
||||||
|
/// The nonce can be used to detect situations when a node accidentally
|
||||||
|
/// connects to itself. Set it to a random value and, in case of incoming
|
||||||
|
/// connections, compare the value - same values mean self-connection.
|
||||||
|
///
|
||||||
|
/// If your application uses P2P to only fetch the data and doesn't listen
|
||||||
|
/// you may just set it to 0.
|
||||||
pub nonce: u64,
|
pub nonce: u64,
|
||||||
/// A string describing the peer's software
|
/// A string describing the peer's software
|
||||||
pub user_agent: String,
|
pub user_agent: String,
|
||||||
|
|
Loading…
Reference in New Issue