Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/SKALED-1693-func-tests-on-bot…
Browse files Browse the repository at this point in the history
…h-builds
  • Loading branch information
dimalit authored Jan 23, 2024
2 parents 5a45a19 + f7f2d13 commit 0690047
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libweb3jsonrpc/Skale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ nlohmann::json Skale::impl_skale_getSnapshot( const nlohmann::json& joRequest, C

// TODO check
unsigned blockNumber = joRequest["blockNumber"].get< unsigned >();
if ( blockNumber != m_client.getLatestSnapshotBlockNumer() ) {
if ( blockNumber != 0 && blockNumber != m_client.getLatestSnapshotBlockNumer() ) {
joResponse["error"] = "Invalid snapshot block number requested - it might be deleted.";
return joResponse;
}
Expand Down Expand Up @@ -370,7 +370,7 @@ Json::Value Skale::skale_getSnapshotSignature( unsigned blockNumber ) {
if ( chainParams.nodeInfo.keyShareName.empty() || chainParams.nodeInfo.sgxServerUrl.empty() )
throw jsonrpc::JsonRpcException( "Snapshot signing is not enabled" );

if ( blockNumber != this->m_client.getLatestSnapshotBlockNumer() ) {
if ( blockNumber != 0 && blockNumber != this->m_client.getLatestSnapshotBlockNumer() ) {
throw jsonrpc::JsonRpcException(
"Invalid snapshot block number requested - it might be deleted." );
}
Expand Down

0 comments on commit 0690047

Please sign in to comment.