Skip to content

Commit

Permalink
Add ServiceFlags::P2P_V2
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Mar 8, 2024
1 parent 9641e2d commit 5818e04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions bitcoin/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ mod tests {
ServiceFlags::WITNESS,
ServiceFlags::COMPACT_FILTERS,
ServiceFlags::NETWORK_LIMITED,
ServiceFlags::P2P_V2,
];

let mut flags = ServiceFlags::NONE;
Expand Down
5 changes: 5 additions & 0 deletions bitcoin/src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5818e04

Please sign in to comment.