core: always warn if accepted transaction fails verification

These warnings must be monitored by developers since it might be a sign
of behaviour difference between Go and C# nodes.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-05-15 14:03:20 +03:00
parent 13020ccd02
commit 59c98c4d09

View file

@ -1515,9 +1515,12 @@ func (bc *Blockchain) AddBlock(block *block.Block) error {
} else { } else {
err = bc.verifyAndPoolTx(tx, mp, bc) err = bc.verifyAndPoolTx(tx, mp, bc)
} }
if err != nil && bc.config.VerifyTransactions { if err != nil {
if bc.config.VerifyTransactions {
return fmt.Errorf("transaction %s failed to verify: %w", tx.Hash().StringLE(), err) return fmt.Errorf("transaction %s failed to verify: %w", tx.Hash().StringLE(), err)
} }
bc.log.Warn(fmt.Sprintf("transaction %s failed to verify: %s", tx.Hash().StringLE(), err))
}
} }
} }
return bc.storeBlock(block, mp) return bc.storeBlock(block, mp)