Skip to content

Commit

Permalink
changed order of syntactic validation to not fail when fast validatin…
Browse files Browse the repository at this point in the history
…g block with missing atx
  • Loading branch information
antonlerner authored and noamnelke committed Nov 19, 2020
1 parent 03cd0a8 commit cbfb4f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions blocks/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,18 @@ func (bh BlockHandler) blockSyntacticValidation(block *types.Block, syncer servi
}
}

// fast validation checks if there are no duplicate ATX in active set and no duplicate TXs as well
if err := bh.fastValidation(block); err != nil {
bh.Log.Error("failed fast validation block %v e: %v", block.ID(), err)
return err
}

// try fetch referenced ATXs
err := bh.fetchAllReferencedAtxs(block, syncer)
if err != nil {
return err
}

// fast validation checks if there are no duplicate ATX in active set and no duplicate TXs as well
if err := bh.fastValidation(block); err != nil {
bh.Log.Error("failed fast validation block %v e: %v", block.ID(), err)
return err
}

// get the TXs
if len(block.TxIDs) > 0 {
err := syncer.GetTxs(block.TxIDs)
Expand Down

0 comments on commit cbfb4f4

Please sign in to comment.