Add backwards compatibility support to get_highest_snapshot_slot() (#19591)
Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
parent
3936c10aa0
commit
38e1f7c4ba
|
@ -1041,7 +1041,15 @@ impl RpcClient {
|
|||
/// # Ok::<(), ClientError>(())
|
||||
/// ```
|
||||
pub fn get_highest_snapshot_slot(&self) -> ClientResult<RpcSnapshotSlotInfo> {
|
||||
self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
|
||||
if self.get_node_version()? < semver::Version::new(1, 8, 0) {
|
||||
#[allow(deprecated)]
|
||||
self.get_snapshot_slot().map(|full| RpcSnapshotSlotInfo {
|
||||
full,
|
||||
incremental: None,
|
||||
})
|
||||
} else {
|
||||
self.send(RpcRequest::GetHighestSnapshotSlot, Value::Null)
|
||||
}
|
||||
}
|
||||
|
||||
#[deprecated(
|
||||
|
|
Loading…
Reference in New Issue