Skip to content

Commit

Permalink
IS-902 check block number to download snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Jan 12, 2024
1 parent bba2a8a commit 9431fab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libweb3jsonrpc/Skale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ nlohmann::json Skale::impl_skale_getSnapshot( const nlohmann::json& joRequest, C

// TODO check
unsigned blockNumber = joRequest["blockNumber"].get< unsigned >();
if ( blockNumber != m_client.getLatestSnapshotBlockNumer() ) {
joResponse["error"] = "Wrong snapshot block number requested.";
return joResponse;
}

// exit if too early
if ( currentSnapshotBlockNumber >= 0 ) {
Expand Down

0 comments on commit 9431fab

Please sign in to comment.