Skip to content

Commit

Permalink
early return
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Oct 9, 2024
1 parent 5dedc9f commit 38d714e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sequencer/src/catchup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ impl<ApiVer: StaticVersionType> StateCatchup for StatePeers<ApiVer> {
.await
{
Ok(res) => {
if res.proof.account == account.into() {
match res.proof.verify(&fee_merkle_tree_root) {
Ok(_) => return Ok(res),
Err(err) => tracing::warn!("Error verifying account proof: {}", err),
}
} else {
if res.proof.account != account.into() {
tracing::warn!("Invalid proof received from peer {:?}", client.url);
continue;
}

match res.proof.verify(&fee_merkle_tree_root) {
Ok(_) => return Ok(res),
Err(err) => tracing::warn!("Error verifying account proof: {}", err),
}
}
Err(err) => {
Expand Down

0 comments on commit 38d714e

Please sign in to comment.