changed order of syntactic validation to not fail when fast validating
changed order of syntactic validation to not fail when fast validating block with missing atx
@@ -3,7 +3,6 @@ package blocks
import (
"errors"
"fmt"
-
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
"github.com/spacemeshos/go-spacemesh/p2p/service"
@@ -151,18 +150,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.With().Error("failed fast validation", block.ID(), log.Err(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.With().Error("failed fast validation", block.ID(), log.Err(err))
+ return err
+ }
+
// get the TXs
if len(block.TxIDs) > 0 {
err := syncer.GetTxs(block.TxIDs)
