Skip to content

Commit

Permalink
[Example] Add a protocol version to reflect removing Shards:
Browse files Browse the repository at this point in the history
* Not actually useful, because older clients won't speak this protocol
  version, and newer clients won't support Shards
  • Loading branch information
ximinez committed Jul 31, 2024
1 parent a33eba0 commit f978447
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/xrpld/overlay/Peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum class ProtocolFeature {
ValidatorListPropagation,
ValidatorList2Propagation,
LedgerReplay,
Shards,
};

/** Represents a peer connection in the overlay. */
Expand Down
3 changes: 3 additions & 0 deletions src/xrpld/overlay/detail/PeerImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ PeerImp::supportsFeature(ProtocolFeature f) const
return protocol_ >= make_protocol(2, 2);
case ProtocolFeature::LedgerReplay:
return ledgerReplayEnabled_;
case ProtocolFeature::Shards:
// Shards was removed in protocol version 2.3
return protocol_ < make_protocol(2, 3);
}
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion src/xrpld/overlay/detail/ProtocolVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ namespace ripple {
constexpr ProtocolVersion const supportedProtocolList[]
{
{2, 1},
{2, 2}
{2, 2},
{2, 3}
};
// clang-format on

Expand Down

0 comments on commit f978447

Please sign in to comment.