Skip to content

Commit

Permalink
Add tip_hash and tip_number to sync_state rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Oct 31, 2023
1 parent a818770 commit 4a6fac8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rpc/src/module/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ impl NetRpc for NetRpcImpl {
.into(),
unverified_tip_number: unverified_tip.number().into(),
unverified_tip_hash: unverified_tip.hash().unpack(),
tip_number: chain.tip_number().into(),
tip_hash: chain.tip_hash().unpack(),
fast_time: fast_time.into(),
normal_time: normal_time.into(),
low_time: low_time.into(),
Expand Down
3 changes: 3 additions & 0 deletions util/jsonrpc-types/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ pub struct SyncState {
pub unverified_tip_number: BlockNumber,
/// The block hash of current unverified tip block
pub unverified_tip_hash: H256,

pub tip_number: BlockNumber,
pub tip_hash: H256,
/// The download scheduler's time analysis data, the fast is the 1/3 of the cut-off point, unit ms
pub fast_time: Uint64,
/// The download scheduler's time analysis data, the normal is the 4/5 of the cut-off point, unit ms
Expand Down

0 comments on commit 4a6fac8

Please sign in to comment.