diff --git a/bitcoin/src/network.rs b/bitcoin/src/network.rs index 1dc3b106..4483bb8e 100644 --- a/bitcoin/src/network.rs +++ b/bitcoin/src/network.rs @@ -347,6 +347,7 @@ mod tests { ServiceFlags::WITNESS, ServiceFlags::COMPACT_FILTERS, ServiceFlags::NETWORK_LIMITED, + ServiceFlags::P2P_V2, ]; let mut flags = ServiceFlags::NONE; diff --git a/bitcoin/src/p2p/mod.rs b/bitcoin/src/p2p/mod.rs index ae42ae99..3d8709fa 100644 --- a/bitcoin/src/p2p/mod.rs +++ b/bitcoin/src/p2p/mod.rs @@ -91,6 +91,10 @@ impl ServiceFlags { /// See BIP159 for details on how this is implemented. pub const NETWORK_LIMITED: ServiceFlags = ServiceFlags(1 << 10); + /// P2P_V2 indicates that the node supports the P2P v2 encrypted transport protocol. + /// See BIP324 for details on how this is implemented. + pub const P2P_V2: ServiceFlags = ServiceFlags(1 << 11); + // NOTE: When adding new flags, remember to update the Display impl accordingly. /// Add [ServiceFlags] together. @@ -150,6 +154,7 @@ impl fmt::Display for ServiceFlags { write_flag!(WITNESS); write_flag!(COMPACT_FILTERS); write_flag!(NETWORK_LIMITED); + write_flag!(P2P_V2); // If there are unknown flags left, we append them in hex. if flags != ServiceFlags::NONE { if !first {