mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 13:06:20 +00:00
block: return error from Verify
Don't hide real problem behind the bool value. Makes it easier to identify problems when looking at log messages.
This commit is contained in:
parent
258f397b9a
commit
16bc5296cb
3 changed files with 14 additions and 10 deletions
|
@ -210,8 +210,9 @@ func (bc *Blockchain) AddBlock(block *Block) error {
|
|||
return fmt.Errorf("expected block %d, but passed block %d", expectedHeight, block.Index)
|
||||
}
|
||||
if bc.verifyBlocks {
|
||||
if !block.Verify(false) {
|
||||
return fmt.Errorf("block %s is invalid", block.Hash())
|
||||
err := block.Verify(false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("block %s is invalid: %s", block.Hash().ReverseString(), err)
|
||||
}
|
||||
for _, tx := range block.Transactions {
|
||||
err := bc.Verify(tx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue