mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 15:07:59 +00:00
system_syncState: Always return highest block (#11979)
Before `highestBlock` was an optional that was omitted when it was `None`. We recently changed the way the `highestBlock` is determined, this resulted in having this value in 99.99% of the time being `None` when the node is syncing blocks at the tip. Now we always return a block for `highestBlock`. If sync doesn't return us any best seen block, we return our own local best block as `highestBlock`. This should mainly reflect the same behavior to before we changed the way the best seen block is determined.
This commit is contained in:
@@ -264,10 +264,12 @@ async fn build_network_future<
|
||||
sc_rpc::system::Request::SyncState(sender) => {
|
||||
use sc_rpc::system::SyncState;
|
||||
|
||||
let best_number = client.info().best_number;
|
||||
|
||||
let _ = sender.send(SyncState {
|
||||
starting_block,
|
||||
current_block: client.info().best_number,
|
||||
highest_block: network.best_seen_block(),
|
||||
current_block: best_number,
|
||||
highest_block: network.best_seen_block().unwrap_or(best_number),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user